Guest User

Untitled

a guest
Oct 16th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. var jQueryReady = function($) {
  2.  
  3. // Your code goes here...
  4. console.log('jQuery Ready!');
  5. };
  6.  
  7. // Make sure jQuery is ready.
  8. if (typeof jQuery == 'undefined') {
  9. var protocol = window.location.protocol;
  10. if (protocol.charAt(protocol.length - 1) == ':') {
  11. protocol = protocol.substring(0, protocol.length - 1);
  12. }
  13. var tag = document.createElement('script');
  14. var src = protocol;
  15. src += '://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js';
  16. tag.src = src;
  17. var firstScriptTag = document.getElementsByTagName('script')[0];
  18. firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  19. setTimeout(function tryAgain() {
  20. if (typeof jQuery == 'undefined') {
  21. setTimeout(tryAgain, 200);
  22. }
  23. else {
  24. jQueryReady(jQuery);
  25. }
  26. }, 200);
  27. }
Add Comment
Please, Sign In to add comment