Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

onBeforeLoad event not triggered

 
Viidhya Kishore
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
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.

Vidhya
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
onBeforeLoad is not a standard event and is not supported by most browsers. You shouldn't use it.

Beside:
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic