It is also possible to delay the jQuery's ready event. holdReady is a signal/flag to hold this triggering. holdReady was included in 1.6 version
There is a method jQuery.holdReady() that allows caller to delay the triggering of ready event.
This method must be called early in the document, such as in the <head> immediately after the jQuery script tag. There will be no effect if we call the method after the ready event has alredy triggered.
This advanced feature would typically be used by dynamic script loaders that want to load additional JavaScript such as jQuery plugins before allowing the ready event to occur, even though the DOM may be ready.
To delay the ready event, first call $.holdReady(true). When the ready event should be released to execute, call $.holdReady(false).
There can be multiple holds on the ready event, one for each $.holdReady(true) call. But in such a situation each of the hold should be released with a corresponding number of $.holdReady(false) calls, only then the ready event can get fired.
Example:
Delay the ready event until a custom plugin has loaded:
$.getScript("myplugin.js", function() {
$.holdReady(false);
});