Skip to content

Instantly share code, notes, and snippets.

@ptbrowne
Created June 5, 2014 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptbrowne/9c8a17840564e55c31eb to your computer and use it in GitHub Desktop.
Save ptbrowne/9c8a17840564e55c31eb to your computer and use it in GitHub Desktop.
AddScript Bookmarklet
javascript:(function(){(function(){var el=document.createElement('div'),b=document.getElementsByTagName('body')[0],otherlib=false,msg='';function getScript(url,success){var script=document.createElement('script');script.src=url;var head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;success();script.onload=script.onreadystatechange=null;head.removeChild(script);}};head.appendChild(script);}getScript(prompt(),function(){if(typeof jQuery=='undefined'){msg='NOK';}else{msg='OK';if(otherlib){msg+=' and noConflict(). Use $jq(), not $().';}}return showMsg();});function showMsg(){console.log(msg)}})();})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment