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



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

Answer / chaitanya

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.

Hide Copy Code



$.holdReady(true);

$.getScript("myplugin.js", function() {

$.holdReady(false);

});

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

Can you please explain the difference between .js and .min.js? : jquery mobile

1 Answers  


Define the use jquery.data method?

1 Answers  


Which one is more efficient, document.getelementbyid( "idname") or $("#idname)?

1 Answers  


Why html 5 inputs look different across devices and browsers? : jquery mobile

1 Answers  


What's next on the hitlist with jquery ui?

1 Answers  


How to multiple version of jQuery?

1 Answers  


How to include jquery library in asp.net project?

1 Answers  


What is parseint() and why it is used?

1 Answers  


What is the use of jQuery.data() method?

1 Answers  


What is difference between sorting string array and sorting numerical array in jquery?

1 Answers  


What is resize() function in jquery?

1 Answers  


How can an element be checked if it contains a specific class?

1 Answers  


Categories