Created
November 6, 2012 11:11
-
-
Save mikermcneil/4024067 to your computer and use it in GitHub Desktop.
Bookmarklet to grab jQuery on a site that doesn't have it
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
| function loadScript(src,optionalCallback) { var s = document.createElement("script"); s.type = "text/javascript"; s.src = src; var context = document.getElementsByTagName('script')[0]; context.parentNode.insertBefore(s, context); s.async=true; s.addEventListener('load',optionalCallback); } function getjQuery(callback){loadScript("https://stripe.com/javascripts/jquery.js",callback);} getjQuery(function (e) { console.log("\n\n","jQuery loaded successfully!"); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment