This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
Similar Threads
how do get selected value from combobox in html
How to edit javascript in firefox 3.6
How to clear portlet cache?
onload for JSP
Strange behaviour of JSP file