Nice one Jonathan, good to be clear on this stuff =]
Jonathan Chaffer wrote:
On Jun 8, 2007, at 11:36 , Robert O'Rourke wrote:
I'm far from knowing all the facts but I thought .ready() was just a
jquery event for 'onload', for whatever element just loaded. Like
.bind('onload', function(){ ... } );, Is that right?
Mike answered the main question here, but just to clarify:
.load() or .bind('load') is the jQuery way to respond to the "onload"
event. This event only gets fired when the element it is attached to
is *completely* loaded. That means images, etc. must be completely
transferred before the event fires. The .ready() method of jQuery
registers code that will run when the DOM is ready, which could well
be quite a bit before the "onload" event occurs for the page.
It is possible to attach an onload handler to an individual element
(e.g. image) though, which can be useful.
--
Jonathan Chaffer
Technology Officer, Structure Interactive