Skip to content

Instantly share code, notes, and snippets.

@jbosse
Created February 28, 2013 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbosse/5058099 to your computer and use it in GitHub Desktop.
Save jbosse/5058099 to your computer and use it in GitHub Desktop.
dynamic load js
<script>
(function (undefined) {
try {
if (jQuery !== undefined) {
return;
}
} catch (e) {
var body = document.getElementsByTagName('body')[0];
var jqueryScript = document.createElement("script");
console.log(jqueryScript);
jqueryScript.src = '/Scripts/jquery-1.7.2.js';
body.appendChild(jqueryScript);
console.log(body);
}
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment