wyo schrieb:
On Apr 12, 10:41 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
wyo schrieb:

As I understand $(document).ready() is more or less just an enclosure
to make sure the DOM is correcly available for use with jQuery. As it
Yes, the goal should be to separate behavior (JavaScript) and structure
(HTML), just like you (hopefully) already do with presentation (CSS) and
structure.

I try albeit I admit not always, separation isn't always good and I
want to be able to decide when to separate or not.

Sure, that's up to you (but I cannot think of an occasion where separation isn't good).

If you include external scripts in the head, the DOM is not ready,
because at that point it is simply not loaded. You could circumvent this

Well IMO the time when an event is fired is important. Besides isn't
the DOM ready when the Onload is fired?

Yes, but the load event is fired *after* DOM ready. That is the important distinction here. Usually you want to operate on the DOM as soon as you can (via DOM ready event), not after all the images etc. have been loaded, which is when load is fired. I wasn't clear about that.


-- Klaus

Reply via email to