Escape Quote - javascript, struts 2
- by Ahmed Salah
I read some struts2 variable in javascript as follows:
<javascript type="text/javascript">
var data='<s:property value="simulationInfos"/>';
<javascript>
If my simulationInfos contains single quote ', I get the error : unexpected identifier.
therefore, I tried to escape the quote as follows:
var data='<s:property value="simInfos" escapeJavaScript="true"/>';
and var data='<s:property value="simInfos" escapeHTML="true"/>';
I get the error: Attribute escapeJavaScript (or escapeHTML) invalid for tag property according to TLD.
Any Idea?