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
seems this makes the use of any on... event handler obsolete since any
event can be bound in the $(document).ready() enclosure. Is that right
or is there more behind it?

What happens if I still use e.g. onclick somewhere in the page
possibly when this event is already bound to a function in the
enclosure? Should this be avoided? What are the implications?

So far I assumed the DOM was ready when I used Javascript code
anywhere in a page. Was that wrong or why needs jQuery $
(document).ready()?

$(function() is mentioned as a shorthand for $(document).ready(), does
this mean I could use whatever syntax I like more?

jQuery(function($) is mentioned as writing failsafe jQuery code yet I
don't understand what's the difference to the above choices. Does
anybody know?

O. Wyss

Reply via email to