• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript function trying to access Scriptlet value

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Soumyajit Hazra
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change the callMe() function to
This is working for me. Have a try.
 
Prasad Krishnegowda
Ranch Hand
Posts: 670
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Soumyajit and Prasad , its working .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic