Hello,
How can I assign the value of a JSP variable(which contains HTML tags) in a Javascript variable ?
I know that JS is for the client and JSP is server side but it may be possible to assign a Javascript variable once ...
I've tried this but it didn't work:
<%
var myJSP = "<FONT FACE=\"Arial\">Testing...</FONT>";
%>
<SCRIPT language="JavaScript">
function overlap()
{
document.all.mydiv.innerHTML = "<% =myJSP %>";
}
I also tried to use this:
<INPUT TYPE="HIDDEN" NAME="mytest" VALUE="<% =myJSP%>">
And then call in my JS function mytest.value but it only works with string but not HTML tags.
Can someone help me please????? I'm lost.....
How can I assign the value of a JSP variable(which contains HTML tags) in a Javascript variable ?
I know that JS is for the client and JSP is server side but it may be possible to assign a Javascript variable once ...
I've tried this but it didn't work:
<%
var myJSP = "<FONT FACE=\"Arial\">Testing...</FONT>";
%>
<SCRIPT language="JavaScript">
function overlap()
{
document.all.mydiv.innerHTML = "<% =myJSP %>";
}
I also tried to use this:
<INPUT TYPE="HIDDEN" NAME="mytest" VALUE="<% =myJSP%>">
And then call in my JS function mytest.value but it only works with string but not HTML tags.
Can someone help me please????? I'm lost.....