Last active
August 29, 2015 14:11
-
-
Save brianbolger/7506e6f32e8aee60bc80 to your computer and use it in GitHub Desktop.
Tampermonkey script to load jQuery to a page
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
addJQuery(main); | |
function addJQuery(callback) | |
{ | |
var script = document.createElement("script"); | |
script.setAttribute("src", "https://code.jquery.com/jquery-1.11.1.min.js"); | |
script.addEventListener('load', function() { | |
var script = document.createElement("script"); | |
script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();"; | |
document.body.appendChild(script); | |
}, false); | |
document.body.appendChild(script); | |
} | |
function main() | |
{ | |
alert("jQuery loaded & ready!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment