javascript - How to store value of var in Spring message tag in java script function? -


i have 1 function returning kind of string string not static dynamic

<code of script function> var error_msg = sendpinajaxresponse("some url"); 

and using spring message tag change language

 $("#error_div").html('<spring:message javascriptescape="true" code="static string" />') 

when pass static string works fine

but want store dynamic value of var, using var 'error_msg'

 $("#error_div").html('<spring:message javascriptescape="true" code= error_msg />') 

its giving exception on jsp page

 quote symbol expected 

try it:

$("#error_div").html('<spring:message javascriptescape="true" code="' + error_msg + '"/>') 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -