Last active
December 16, 2015 02:39
-
-
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
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
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)}})(); |
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
(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