-1

I have one function that is returning some kind of string string is not static it is dynamic

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

And i am using spring message tag to change language

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

when i pass static string it works fine

but i want to store dynamic value of var, now i am using the var 'error_msg'

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

its giving an exception on jsp page

 quote symbol expected
Kunal Batra
  • 821
  • 3
  • 14
  • 35
  • This question does not appear to be about programming within the scope defined in the help center. – Roman C Sep 26 '16 at 09:16

1 Answers1

-1

Try it:

$("#error_div").html('<spring:message javaScriptEscape="true" code="' + error_msg + '"/>')
Maxx
  • 1,740
  • 10
  • 17