hello everybody ,
i have a doubt actually i am trying to assign a javascript variable to jsp variable is it possible to do that ???
if so how can i do that ?????
thanks
raghu,
Printable View
hello everybody ,
i have a doubt actually i am trying to assign a javascript variable to jsp variable is it possible to do that ???
if so how can i do that ?????
thanks
raghu,
No, you can't do that. JSP code runs when the HTML is generated at the Web application server. Javascript runs when the HTML is rendered by the browser.
You could assign a JSP variable to a Javascript one easy enough but the other way round you're going to have to send data to the server one way or another (eg form post, AJAX)
Code:<% int number=10; %>
<script language="JavaScript">
var numb='<%=number%>';
</script>
But vice versa I have not seen.