Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<!DOCTYPE html>
	Test for jQuery.holdReady. Needs to be a
	standalone test since it deals with DOM
		jQuery.holdReady Test
		div { margin-top: 10px; }
		#output { background-color: green }
		#expectedOutput { background-color: green }
	<script src="../dist/jquery.js"></script>

	<!-- Load the script loader that uses
		jQuery.readyWait -->
	<script src="data/readywaitloader.js"></script>

	<script type="text/javascript">
	jQuery(function() {
		// The delayedMessage is defined by
		// the readywaitasset.js file, so the
		// next line will only work if this DOM
		// ready callback is called after readyWait
		// has been decremented by readywaitloader.js
		// If an error occurs.
		jQuery.holdReady Test
		This is a test page for jQuery.readyWait and jQuery.holdReady,
		<a href="">#6781</a>
		<a href="">#8803</a>.
	Test for jQuery.holdReady, which can be used
	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.
	Script loaders are the most likely kind of script
	to use jQuery.holdReady, but it could be used by
	other things like a script that loads a CSS file
	and wants to pause the DOM ready callbacks.
	<strong>Expected Result</strong>: The text
	<span id="expectedOutput">It Worked!</span>
	appears below after about <strong>2 seconds.</strong>
	If there is an error in the console,
	or the text does not show up, then the test failed.
	<div id="output"></div>
New to GrepCode? Check out our FAQ X