How to Assign JavaScript variable to Jsp Variable

  • Thread starter Thread starter Ranjan
  • Start date Start date
R

Ranjan

Hi,
I want to assign javaScript variable to JSP variable.

<Script>
var conf=Confirm("Mess");
if(conf)
{
<% String str=conf; /// line 1
%>
}
else
{
}

i know line no 1 is wrong.
i did this way also.
<% String str ="<script>document.writeln(conf)</script>"; %>

but now string gives output <script>conf</script>

so plz short this problem. I read in lots of group so many wrote there
it may be the client side an d server side problem.

thanks,
Prabhat
 
Back
Top