Created
May 8, 2012 22:51
-
-
Save NigelThorne/2640138 to your computer and use it in GitHub Desktop.
Load JQuery & JQueryUI programatically
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
//Taken from http://www.jquery4u.com/javascript/dynamically-load-jquery-library-javascript/ | |
//Load jQuery library using plain JavaScript | |
(function(){ | |
var newscript = document.createElement('script'); | |
newscript.type = 'text/javascript'; | |
newscript.async = true; | |
newscript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'; | |
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(newscript); | |
})(); | |
//Load jQuery library using plain JavaScript | |
(function(){ | |
var newscript = document.createElement('script'); | |
newscript.type = 'text/javascript'; | |
newscript.async = true; | |
newscript.src = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js'; | |
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(newscript); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment