Anil Kumar
What is difference between jQuery's ready and holdReady ?
By Anil Kumar in JQuery on Nov 24 2012
  • Pranam Bhat
    May, 2021 22

    1) ready() The ready() method is used to make a function available after the document is loaded. Whatever code you write inside the $(document ).ready() method will run once the page DOM is ready to execute JavaScript code.Example:You can try to run the following code to learn how to use $(document).ready() method in jQuery: jQuery Function

    Click on this to see a dialogue box.
    2) jQuery.hokdReady() :Holds or releases the execution of jQuery's ready event.Example:Delay the ready event until a custom plugin has loaded.$.holdReady( true ); $.getScript( "myplugin.js", function() {$.holdReady( false ); });

    • 0
  • Anil Kumar
    Nov, 2012 24

    jQuery's ready is an event which gets triggered automatically when DOM is ready while holdReady is a signal/flag to hold this triggering. holdReady was included in 1.6 version and it works only if used before the execution/triggering of ready event. Once ready event is fired, it has nothing to do. It is useful in dynamically loading scripts before the ready starts. It release ready event execution when used with a true parameter. 

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS