readywait.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <!DOCTYPE html>
  2. <html>
  3. <!--
  4. Test for jQuery.holdReady. Needs to be a
  5. standalone test since it deals with DOM
  6. ready.
  7. -->
  8. <head>
  9. <title>
  10. jQuery.holdReady Test
  11. </title>
  12. <style>
  13. div { margin-top: 10px; }
  14. #output { background-color: green }
  15. #expectedOutput { background-color: green }
  16. </style>
  17. <script src="jquery.js"></script>
  18. <!-- Load the script loader that uses
  19. jQuery.readyWait -->
  20. <script src="data/readywaitloader.js"></script>
  21. <script type="text/javascript">
  22. jQuery(function() {
  23. // The delayedMessage is defined by
  24. // the readywaitasset.js file, so the
  25. // next line will only work if this DOM
  26. // ready callback is called after readyWait
  27. // has been decremented by readywaitloader.js
  28. // If an error occurs.
  29. jQuery("#output").append(delayedMessage);
  30. });
  31. </script>
  32. </head>
  33. <body>
  34. <h1>
  35. jQuery.holdReady Test
  36. </h1>
  37. <p>
  38. This is a test page for jQuery.readyWait and jQuery.holdReady,
  39. see
  40. <a href="http://bugs.jquery.com/ticket/6781">#6781</a>
  41. and
  42. <a href="http://bugs.jquery.com/ticket/8803">#8803</a>.
  43. </p>
  44. <p>
  45. Test for jQuery.holdReady, which can be used
  46. by plugins and other scripts to indicate something
  47. important to the page is still loading and needs
  48. to block the DOM ready callbacks that are registered
  49. with jQuery.
  50. </p>
  51. <p>
  52. Script loaders are the most likely kind of script
  53. to use jQuery.holdReady, but it could be used by
  54. other things like a script that loads a CSS file
  55. and wants to pause the DOM ready callbacks.
  56. </p>
  57. <p>
  58. <strong>Expected Result</strong>: The text
  59. <span id="expectedOutput">It Worked!</span>
  60. appears below after about <strong>2 seconds.</strong>
  61. </p>
  62. <p>
  63. If there is an error in the console,
  64. or the text does not show up, then the test failed.
  65. </p>
  66. <div id="output"></div>
  67. </body>
  68. </html>