Created
November 23, 2014 23:01
-
-
Save fafaradesigns/8be7beaa2ef477960aeb to your computer and use it in GitHub Desktop.
JQUERY:jQueryLoader.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jQueryScriptOutputted = false; | |
function initJQuery() { | |
//if the jQuery object isn't available | |
if (typeof(jQuery) == 'undefined') { | |
if (! jQueryScriptOutputted) { | |
//only output the script once.. | |
jQueryScriptOutputted = true; | |
//output the script (load it from google api) | |
document.write("<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js\"></script>"); | |
} | |
setTimeout("initJQuery()", 50); | |
} else { | |
jQuery(function() { | |
//do anything that needs to be done on document.ready | |
}); | |
} | |
} | |
initJQuery(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment