Created
July 15, 2011 15:47
-
-
Save jwo/1084936 to your computer and use it in GitHub Desktop.
Dynamically load javascript source files
This file contains 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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script> | |
<script> | |
//<![CDATA[ | |
window.jQuery || document.write("<script src='/javascripts/jquery.min.js'>\x3C/script>") | |
//]]> | |
</script> |
This file contains 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
if(typeof yourFunctionToCheck != 'function') { | |
$.getScript("ajax/test.js", function(){ | |
// callback if needed | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment