Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. var appendQUnit = document.createElement('script');
  2. appendQUnit.src = 'js/utility/qunit/qunit.js';
  3. appendQUnit.type = 'text/javascript';
  4. document.getElementsByTagName('head')[0].appendChild(appendQUnit);
  5.  
  6. $.getScript('js/utility/qunit/qunit.js', function() {
  7. // here you can handle the qunit code
  8. });
  9.  
  10. $.getScript('js/utility/qunit/qunit.js', function(){
  11. QUnit.load();
  12. // here you can handle the qunit code
  13. });
  14.  
  15. void(function foo()
  16. {
  17. /* get head element */
  18. var head=document.getElementsByTagName("head")[0];
  19.  
  20. /* create script and link elements */
  21. var qUnitJS = document.createElement("script");
  22. var qUnitCSS = document.createElement("link");
  23.  
  24. /* link rel and type attributes required for lazy loading */
  25. qUnitCSS.rel="stylesheet";
  26. qUnitCSS.type="text/css";
  27.  
  28. /* define script src attribute to lazy load */
  29. qUnitJS.src = "http://qunitjs.com/resources/qunit.js";
  30.  
  31. /* append script and link elements */
  32. head.appendChild(qUnitJS);
  33. head.appendChild(qUnitCSS);
  34.  
  35. /* define link href after DOM insertion to lazy load */
  36. qUnitCSS.href="http://qunitjs.com/resources/qunit.css";
  37.  
  38. /* call tests after QUnit loads */
  39. qUnitJS.onload = function () {};
  40. }() )
  41.  
  42. security.mixed_content.block_active_content
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement