Last active
December 9, 2015 19:29
-
-
Save sebnilsson/4317014 to your computer and use it in GitHub Desktop.
Update jQuery on-the-fly in Javascript
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
console.log($().jquery); // Show original jQuery-version | |
// Closure | |
var $gs = $.getScript; | |
// http://api.jquery.com/jQuery.noConflict/ | |
// jQuery.noConflict( [removeAll] ) | |
// removeAll: A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). | |
$.noConflict(true); | |
// Get script | |
$gs('http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', function() { | |
console.log($().jquery); // Show updated jQuery-version | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment