I am retrieving a string from the messages file (a string resource file with key and values) and trying to store it in a javascript variable . It apparently contains characters that javascript does not like. How can I retrieve the string from the messages file without having to edit all the strings in the messages file, to avoid the “Unexpected identifier” error message which kills the entire script? I tried adding quotes around: “&{ ‘pages.’+_section+’.footnote.’+_page+’.html’ }” but it did not help…
crashes right here:
var sRefTxt = "&{ 'pages.'+_section+'.footnote.'+_page+'.html' }";
My Play! version is 1.2.4
The
&{''}syntax is a shortcut to load a message. It takes a string as a parameter. You cannot use variables in here.Instead of using this syntax:
You can use this:
For your example, it would be: