Skip to content

Instantly share code, notes, and snippets.

@edankwan
Last active December 16, 2015 02:39
Show Gist options
  • Save edankwan/5364154 to your computer and use it in GitHub Desktop.
Save edankwan/5364154 to your computer and use it in GitHub Desktop.
A snippet which will show an input prompt that you can inject the library from the cdn to the current website for debugging
javascript:(function(){var a=prompt("Enter the url: ","//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js");if(a.length>0){var b=document.createElement("script"),c=document.getElementsByTagName("script")[0];b.src=a,c.parentNode.insertBefore(b,c)}})();
(function(){
var url = prompt ('Enter the url: ', '//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js');
if(url.length > 0) {
var script = document.createElement('script');
var firstScript = document.getElementsByTagName('script')[0];
script.src = url;
firstScript.parentNode.insertBefore(script, firstScript);
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment