This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Strange behaviour of JSP file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Strange behaviour of JSP file" Watch "Strange behaviour of JSP file" New topic

Strange behaviour of JSP file

kiran bayyana

Joined: Aug 15, 2000
Posts: 17
Hi all,
I am developing a JSP file and I wrote code for animating two images for that file. I want to run that code(JS function) in the body load event. But if I have JSP tags in my files, BODY's onload event is not working. I tried it without JSP tags(pure HTML and JS) and with other event handlers, it is working fine. Anybody, pls help. I tried image onLoad also, but it is getting into a loop continuously downloading the two images from the server.
- Kiran
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12760
I suggest you do a view-source of the page produced by your JSP and go over it very carefully. Even a single misplaced " could be causing trouble.
kiran bayyana

Joined: Aug 15, 2000
Posts: 17
I got the solution for my problem. Actually, I am writing a jsp include tag and including another HTML file. So, since there are two BODY tags, the onLoad event of BODY is not working. Anyway, thanks William for your reply.
It is sorta covered in the JavaRanch Style Guide.
subject: Strange behaviour of JSP file
Similar Threads
Directory Structure JSP & JS
calling js file from jsp.
onload not working with jsp
onreadystate change not working for iframe
Load jsp into div tag of another jsp