top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

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

+2 votes
204 views
Is it possible to hold or delay document.ready execution for sometime?
posted Jul 17, 2015 by Shivaranjini

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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);
});

answer Jul 24, 2015 by Karthick.c
...