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

How can you get the type of arguments passed to a function?

0 Answers  


What is finish method in jQuery?

1 Answers  


How can images be made to appear scrolling one over another?

0 Answers  


What is the use of html() method in jquery?

0 Answers  


What does dollar sign ($) me in jquery?

0 Answers  


How to write cookies in jquery?

0 Answers  


What are the four parameters used for jQuery Ajax method?

0 Answers  


How do you check if an element is empty?

1 Answers  


How you will use jquery means requirement needed for using jquery.

0 Answers  


Explain .siblings() method in jquery?

0 Answers  


What are selectors in jquery? : jQuery Mobile

0 Answers  


What does jQuery data() function do?

0 Answers  


Categories