Created
May 13, 2014 20:55
-
-
Save chasingmaxwell/ae39f0c120771821dead to your computer and use it in GitHub Desktop.
Run latest version of jQuery from console.
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 you're working on a project that doesn't have jQuery or is using an old | |
* version, you can take advantage of the latest jQuery for debugging and | |
* troubleshooting from he console! | |
* | |
* Enter the following code into the console following the instructions in the | |
* comments. Once you're done, you should be able to use $l alongside | |
* any version of jQuery that already exists. | |
* | |
* I put this together with help from these posts: | |
* http://stackoverflow.com/questions/7474354/include-jquery-in-the-javascript-console | |
* http://adamlofting.com/493/loading-a-new-version-of-jquery-without-breaking-an-old-version/ | |
*/ | |
// Load the latest version of jQuery. | |
var jq = document.createElement('script'); | |
jq.src = "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
// Wait a bit to make sure it's loaded. Then run: | |
var $l = $.noConflict(false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment