Last active
December 9, 2015 15:57
-
-
Save greyaperez/5a47628b194b2a17b157 to your computer and use it in GitHub Desktop.
Inject jQuery from Dev Console on any Page
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
var JS_LIB = { | |
ANGULAR: 'https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js', | |
JQUERY: 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js', | |
LODASH: 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js' | |
} | |
// Inject jQuery & Lodash | |
function injectAndRun(lib, callback) { | |
(function(d, script) { | |
script = d.createElement('script'); | |
script.type = 'text/javascript'; | |
script.async = true; | |
script.onload = function(){ | |
if (callback) { | |
callback(); | |
} | |
}; | |
script.src = lib; | |
d.getElementsByTagName('head')[0].appendChild(script); | |
}(document)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment