File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes onBeforeLoad event not triggered 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 » Engineering » HTML, CSS and JavaScript
Bookmark "onBeforeLoad event not triggered" Watch "onBeforeLoad event not triggered" New topic

onBeforeLoad event not triggered

Viidhya Kishore
Ranch Hand

Joined: Jan 03, 2007
Posts: 99
My requirement is :

I need to insert a record into a table before page load.
when the page loads I fetch record from the table and show the record.

I am trying to do something very basic like I am doing a db connection at the JSP itself(as this is supposed to be a working prototype)

so, I successfully inserted into the table.

Now my issue is ;
My <body> is having the html for the table that I am to display with the select.

Now I tried to write a 'onBeforeLoad' event in the <body>
which will trigger the select and sudmit the form to get me the data.

But the onBeforeLoad event just is not getting triggered.

Also,if I submit the form on the 'onBeforeLoad' event will my table still load up?

Please help.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60800

onBeforeLoad is not a standard event and is not supported by most browsers. You shouldn't use it.

Now I tried to write a 'onBeforeLoad' event in the <body>
which will trigger the select and sudmit the form to get me the data.
How can you expect to trigger anything that hasn't been loaded yet?

What are you really trying to accomplish? Why aren't you just dealing with this on the server before the JSP gets loaded?
[ July 30, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
wood burning stoves
subject: onBeforeLoad event not triggered
Similar Threads
Having trouble with javascript ...
displaying data from two table in single jsp page
How to keep the selected value ?
A href command not working
showing variable field from database. table.