Saturday, 24 August 2013

Previous Interview Question Next Interview Question
Home

Is it possible to hold or delay document.ready execution for sometime?

Yes, its possible. With Release of jQuery 1.6, a new method "jQuery.holdReady(hold)" was introduced. This method allows to delay the execution of document.ready() event. document.ready() event is called as soon as your DOM is ready but sometimes there is a situation when you want to load additional JavaScript or some plugins which you have referenced.
​
$.holdReady(true);
$.getScript("myplugin.js", function() {
     $.holdReady(false);
});

Previous Interview Question Next Interview Question
Home

0 comments :

Post a Comment