How can I set a JavaScript variable from within a JSP page?

Vasu devan

You can pass the value of a Java variable to a hidden field in a JSP as:

<INPUT TYPE=HIDDEN NAME=JSCRIPTVAR VALUE='<%= javavar %>'>

and use the JavaScript variable inside javascript,

<SCRIPT>
if(JSCRIPTVAR == 100)......
</SCRIPT>

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact