Under what circumstances is jQuery's document.ready() not required?
Posted
by Phil.Wheeler
on Stack Overflow
See other posts from Stack Overflow
or by Phil.Wheeler
Published on 2010-05-11T09:39:45Z
Indexed on
2010/05/11
9:44 UTC
Read the original article
Hit count: 255
jQuery
|best-practices
While John Resig's recommendation is, quite rightly, to declare all events within a jquery.document.ready()
function, I know that you don't actually have to put everything in there. In fact, there are cases where it may be more appropriate to deliberately put methods outside of the ready event.
But what are those cases? Obviously best practice dictates that all events are declared within the ready event, so what would best practice be for declarations outside that event?
© Stack Overflow or respective owner