2011-02-12 02:42:35 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<!--
|
2011-02-03 02:57:44 +00:00
|
|
|
Test for jQuery.holdReady. Needs to be a
|
2011-02-12 02:42:35 +00:00
|
|
|
standalone test since it deals with DOM
|
|
|
|
ready.
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>
|
2011-02-03 02:57:44 +00:00
|
|
|
jQuery.holdReady Test
|
2011-02-12 02:42:35 +00:00
|
|
|
</title>
|
|
|
|
<style>
|
|
|
|
div { margin-top: 10px; }
|
|
|
|
#output { background-color: green }
|
|
|
|
#expectedOutput { background-color: green }
|
|
|
|
</style>
|
2016-09-25 04:12:20 +00:00
|
|
|
<script src="../jquery.js"></script>
|
|
|
|
<script src="./iframeTest.js"></script>
|
2011-02-12 02:42:35 +00:00
|
|
|
|
|
|
|
<!-- Load the script loader that uses
|
|
|
|
jQuery.readyWait -->
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2016-09-25 04:12:20 +00:00
|
|
|
(function() {
|
|
|
|
var released = false;
|
|
|
|
// Hold on jQuery!
|
|
|
|
jQuery.holdReady( true );
|
|
|
|
|
|
|
|
setTimeout( function() {
|
|
|
|
released = true;
|
|
|
|
jQuery.holdReady( false );
|
|
|
|
}, 300 );
|
|
|
|
|
|
|
|
jQuery(function() {
|
|
|
|
jQuery( "#output" ).text( "Ready called, holdReady released: " + released );
|
|
|
|
startIframeTest( released );
|
|
|
|
});
|
|
|
|
})();
|
2011-02-12 02:42:35 +00:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>
|
2011-02-03 02:57:44 +00:00
|
|
|
jQuery.holdReady Test
|
2011-02-12 02:42:35 +00:00
|
|
|
</h1>
|
|
|
|
<p>
|
2012-06-04 16:48:18 +00:00
|
|
|
This is a test page for jQuery.readyWait and jQuery.holdReady,
|
2011-02-03 02:57:44 +00:00
|
|
|
see
|
2015-11-29 17:41:37 +00:00
|
|
|
<a href="https://bugs.jquery.com/ticket/6781">#6781</a>
|
2011-02-03 02:57:44 +00:00
|
|
|
and
|
2015-11-29 17:41:37 +00:00
|
|
|
<a href="https://bugs.jquery.com/ticket/8803">#8803</a>.
|
2011-02-12 02:42:35 +00:00
|
|
|
</p>
|
|
|
|
<p>
|
2011-02-03 02:57:44 +00:00
|
|
|
Test for jQuery.holdReady, which can be used
|
2011-02-12 02:42:35 +00:00
|
|
|
by plugins and other scripts to indicate something
|
|
|
|
important to the page is still loading and needs
|
|
|
|
to block the DOM ready callbacks that are registered
|
|
|
|
with jQuery.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
Script loaders are the most likely kind of script
|
2011-02-03 02:57:44 +00:00
|
|
|
to use jQuery.holdReady, but it could be used by
|
2011-02-12 02:42:35 +00:00
|
|
|
other things like a script that loads a CSS file
|
|
|
|
and wants to pause the DOM ready callbacks.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<strong>Expected Result</strong>: The text
|
|
|
|
<span id="expectedOutput">It Worked!</span>
|
|
|
|
appears below after about <strong>2 seconds.</strong>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
If there is an error in the console,
|
|
|
|
or the text does not show up, then the test failed.
|
|
|
|
</p>
|
|
|
|
<div id="output"></div>
|
|
|
|
</body>
|
|
|
|
</html>
|