load-deferrer-script-element.html 976 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <html>
  2. <head>
  3. <script>
  4. function log(message)
  5. {
  6. document.getElementById("result").innerHTML += message + "<br>";
  7. }
  8. function loadJSFile(){
  9. var s = document.createElement('script')
  10. s.setAttribute("type", "text/javascript")
  11. s.setAttribute("src", "resources/load-deferrer-script-element.js")
  12. document.getElementsByTagName("head")[0].appendChild(s);
  13. }
  14. jsLoaded = false;
  15. runningModal = false;
  16. // This line will load external script into memory.
  17. loadJSFile();
  18. function runModal()
  19. {
  20. jsLoaded = true;
  21. loadJSFile();
  22. runningModal = true;
  23. alert("Scripts should not be running in the background!");
  24. runningModal = false;
  25. }
  26. </script>
  27. </head>
  28. <body>
  29. <p>This tests the bug https://bugs.webkit.org/show_bug.cgi?id=38910.
  30. Click the button, wait 5 seconds and close it.
  31. The test passes if no error messages show up in the page!</p>
  32. <input id="button" type="button" value="click me" onclick="runModal()"/>
  33. <p id="result"></p>
  34. </body>
  35. </html>