| Author |
Javascript function trying to access Scriptlet value
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Hi, As far as i know inside a JSP page Java is executed first and then Javascriptcode .
But this code is not executing as the variable 'a' inside the javascript function is not finding its value .please indicate what might be the error .
Thanks for reading .
|
Save India From Corruption - Anna Hazare.
|
 |
Soumyajit Hazra
Ranch Hand
Joined: Jun 26, 2007
Posts: 136
|
|
change the callMe() function to
This is working for me. Have a try.
|
Java Programmer | SCJP 1.5 | SCWCD 1.4
|
 |
Prasad Krishnegowda
Ranch Hand
Joined: Apr 25, 2010
Posts: 503
|
|
Ravi Kiran V wrote:
In the above function, browser thinks 'a' is a javascript variable, but its not, so use alert("Inside the Body Onload"+<%=a%>);
it should work..
|
Regards, Prasad
SCJP 5 (93%)
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
|
Thanks Soumyajit and Prasad , its working .
|
 |
 |
|
|
subject: Javascript function trying to access Scriptlet value
|
|
|