Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. function loadFirst(filename, filetype) {
  2. if(filetype == "js") {
  3. var node = document.createElement('script');
  4. node.setAttribute("type", "text/javascript");
  5. node.setAttribute("async", true);
  6. node.setAttribute("src", filename);
  7. } else if(filetype == "css") {
  8. var node = document.createElement("link");
  9. node.setAttribute("rel", "stylesheet");
  10. node.setAttribute("type", "text/css");
  11. node.setAttribute("href", filename);
  12. }
  13. if(typeof node != "undefined") {
  14. var h = document.getElementsByTagName("head")[0];
  15. h.parentNode.insertBefore(node, h);
  16. }
  17. }
  18.  
  19. /* Load all CSS first and JS files for your site here. */
  20. window.addEventListener('load', function() {
  21. loadFirst("//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js", "js");
  22. loadFirst("//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css", "css");
  23. loadFirst("//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js", "js");
  24. loadFirst("//fonts.googleapis.com/css?family=Open+Sans:300&subset=latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese", "css");
  25. });
  26.  
  27. //loadFirst("//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js", "js");
  28.  
  29. <script async src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  30.  
  31. $('.carousel').carousel({
  32. interval: 3000,
  33. pause: false
  34. })
  35.  
  36. Uncaught ReferenceError: $ is not defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement