Last active
August 29, 2015 14:14
-
-
Save rajiteh/c5031bfb5d2adb987c6a to your computer and use it in GitHub Desktop.
Inject jQuery to any website with this one simple trick!
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
//Paste this on the console. | |
//Your jQ code should go in function 'jqExec' | |
//You can override the version by changing the 'version' parameter. | |
(function(version) { | |
if (typeof version == "undefined") { version = "2.1.1"; } | |
var script = document.createElement("script"); | |
script.src = "https://code.jquery.com/jquery-" + version + ".min.js"; | |
script.type = "text/javascript"; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
var interval = setInterval(function() { | |
if (typeof jQuery === "function") { | |
clearInterval(interval); | |
jqExec(jQuery); | |
} | |
}, 500); | |
function jqExec($) { | |
alert($.fn.jquery); | |
} | |
})("1.9.0"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment