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?
Edit
Remember, I’m not just after the less-obvious stuff, but I’d like to get a good account of the obvious parts as well. For example, if I’m writing a plugin, I wouldn’t encapsulate that code in a jquery.document.ready() call.
Put everything in jquery.document.ready() which:
What can postponed is: