I am trying to assign JSP String variable to Javascript variable.
For that i use the follwing code
<% String str="Raja"; %>
var s=<%=str%>;
alert(s);
But this code is not worked.
Instead of writting var s=<%=str%>;
I try var s='<%=str%>';
I try var s="<%=str%>";
this code also not worked.
Kindly help me.
For that i use the follwing code
<% String str="Raja"; %>
var s=<%=str%>;
alert(s);
But this code is not worked.
Instead of writting var s=<%=str%>;
I try var s='<%=str%>';
I try var s="<%=str%>";
this code also not worked.
Kindly help me.