Skip to content

Instantly share code, notes, and snippets.

@mikermcneil
Created November 6, 2012 11:11
Show Gist options
  • Select an option

  • Save mikermcneil/4024067 to your computer and use it in GitHub Desktop.

Select an option

Save mikermcneil/4024067 to your computer and use it in GitHub Desktop.
Bookmarklet to grab jQuery on a site that doesn't have it
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