Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var jQueryReady = function($) {
- // Your code goes here...
- console.log('jQuery Ready!');
- };
- // Make sure jQuery is ready.
- if (typeof jQuery == 'undefined') {
- var protocol = window.location.protocol;
- if (protocol.charAt(protocol.length - 1) == ':') {
- protocol = protocol.substring(0, protocol.length - 1);
- }
- var tag = document.createElement('script');
- var src = protocol;
- src += '://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js';
- tag.src = src;
- var firstScriptTag = document.getElementsByTagName('script')[0];
- firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
- setTimeout(function tryAgain() {
- if (typeof jQuery == 'undefined') {
- setTimeout(tryAgain, 200);
- }
- else {
- jQueryReady(jQuery);
- }
- }, 200);
- }
Add Comment
Please, Sign In to add comment