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

Mention some advantages of jquery.

0 Answers  


What is the difference between the knockout and jquery?

0 Answers  


What is the difference between event.stopPropagation and event.stopImmediatePropagation?

1 Answers  


Can you use multiple document.ready() function on the same page?

0 Answers  


Explain the each() function?

0 Answers  






Can we use our own specific character in the place of $ sign in jQuery?

1 Answers  


How to include jQuery in ASP.Net project?

0 Answers  


What is a cdn? What are the advantages of using cdn?

0 Answers  


How to control page titles in jquery mobile? : jquery mobile

0 Answers  


How to work with jQuery parent(), children() and siblings()?

0 Answers  


Which operating system is more compatible with jQuery?

0 Answers  


What is jquery a client or server scripting?

0 Answers  


Categories