control-freak-ide/Control-Freak-Documentation/jQuery/docs/entries/jQuery.holdReady.json
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

1 line
1.6 KiB
JSON

{"name":"jQuery.holdReady","type":"method","title":"jQuery.holdReady()","deprecated":null,"removed":null,"desc":"Holds or releases the execution of jQuery's ready event.","categories":["core","version/1.6"],"entries":[{"return":"undefined","signatures":{"added":"1.6","argument":{"desc":"Indicates whether the ready hold is being requested or released","name":"hold","type":"Boolean"}},"examples":{"desc":"Delay the ready event until a custom plugin has loaded.","code":"\n$.holdReady( true );\n$.getScript( \"myplugin.js\", function() {\n $.holdReady( false );\n});\n"},"longdesc":"\n <p>The <code>$.holdReady()</code> method allows the caller to delay jQuery's ready event. This <em>advanced feature</em> would typically be used by dynamic script loaders that want to load additional JavaScript such as jQuery plugins before allowing the ready event to occur, even though the DOM may be ready. This method must be called early in the document, such as in the <code>&lt;head&gt;</code> immediately after the jQuery script tag. Calling this method after the ready event has already fired will have no effect. </p>\n <p>To delay the ready event, first call <code>$.holdReady( true )</code>. When the ready event should be released to execute, call <code>$.holdReady( false )</code>. Note that multiple holds can be put on the ready event, one for each <code>$.holdReady( true )</code> call. The ready event will not actually fire until all holds have been released with a corresponding number of <code>$.holdReady( false )</code> calls <em>and</em> the normal document ready conditions are met. (See <a href=\"/ready/\"><code>ready</code></a> for more information.)</p>\n "}]}