Skip to content

Instantly share code, notes, and snippets.

@chasingmaxwell
Created May 13, 2014 20:55
Show Gist options
  • Save chasingmaxwell/ae39f0c120771821dead to your computer and use it in GitHub Desktop.
Save chasingmaxwell/ae39f0c120771821dead to your computer and use it in GitHub Desktop.
Run latest version of jQuery from console.
/**
* 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