As indicated in the header, what was the first event that was fired when the webpage was loaded into the browser? I believe there are events before window.onload. What are they and who is the first to be fired?
If you want to call the event handler before onload, DOMContentLoadedthis is one event that usually fires earlier.
onload
DOMContentLoaded
document.addEventListener('DOMContentLoaded', functionRef, false);
I don't know if this helps, but the firebug / IE Dev Tool is really good for viewing JS events when the page loads. I use this for caputre events and see how they happen.
, :
http://dean.edwards.name/weblog/2005/02/order-of-events/