Hi,
In a JSP :
<script type="text/javascript">
function showAlert(value)
{
alert(value);
}
</script>
<input type="button" onclick="showValue('${requestScope.myvalue}');"/>
I have a problem if ${requestScope.myvalue} return a value with a single quote. For exmple, hello'hello
I need to scape the single quote in hello'hello to hello'\hello because is a argument of a javascript function.
I am trying it with the replace funtion
${fn:replace(requestScope.myvalue,'\'','\\\'')}
But don't work. I need to replace the single quote ' by '\
Do you know how can i get it with the replace function ?
Thanks.