Thomas 'PointedEars' Lahn wrote:
vbgunz wrote:
Thomas 'PointedEars' Lahn wrote:
I noticed that you use the proprietary `window.onload' event handler
property. You should not do that; <body ... onload="listenerFunction()"is
more reliable.
this is something I promised to get to as soon as time permitted. I
thought you were referring to the infamous addLoadEvent method here.
but coming back, I am beginning to think you probably meant something
else?
I was referring to the code you provided, starting with the first line;
I don't see an addLoadEvent() method there, nor is one required.
Anyhow, I knew of addLoadEvent [...]
What are you talking about? There is no such predefined method in
the known host environments.
addLoadEvent is a function created by Simon Willison and here is the
birth page and explanation of it
http://simonwillison.net/2004/May/26/addLoadEvent/
.. I first found out about this function through the Friends of Ed, DOM
Scripting book. I found window.onload = easier at the time. going back
to the book based on cause of what you mentioned, I now understand and
prefer this function over window.onload. this is what I thought you
meant. maybe not exactly known by the name of addLoadEvent *but*
something similar.
I usually nest all my code within window.onload. not exactly because I
need it but I find while learning it is the easiest way to test what I
am working on. If working with window.onload is not exactly wise, what
would you suggest? would you mind clearing up how best to work with
window.onload? e.g., addEventListener?