File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes onload not working with jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "onload not working with jsp" Watch "onload not working with jsp" New topic

onload not working with jsp

nishad km

Joined: Oct 14, 2004
Posts: 7
i have a jsp file in which i m calling a javascript in onload event, that java script method contain only one alert. but it doesnt work.
i called the same javascript fuction on click event of a button then the fuction get called.

i saved the same jsp file as html file then the every thing is ok , i m able to call the javascript function in onload event.

can any one say y one javacript method (onload)is not working in jsp and working in html
Nitish Bahadur
Ranch Hand

Joined: Aug 25, 2003
Posts: 118
Any more details(sample source code) will be greatly appreciated.

Regardless, any javascript code you have in your JSP is never executed by the Container. JSP is executed server side, and Javascript is executed client side, in the browser. So there should be no difference between the HTML or JSP, which I am assuming is producing the same/similar HTML, file containing the javascript.
I agree. Here's the link:
subject: onload not working with jsp
It's not a secret anymore!