Created
November 13, 2012 13:13
-
-
Save matijs/4065707 to your computer and use it in GitHub Desktop.
Bookmarklet to add jQuery to the current document
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(){ | |
if ('jQuery' in window) { | |
console.log('jQuery '+jQuery.fn.jquery+' already present'); | |
} | |
else { | |
var s = document.createElement('script'); | |
s.src = 'http://code.jquery.com/jquery.min.js'; | |
s.onload = function() { | |
console.log('jQuery '+jQuery.fn.jquery+' loaded.'); | |
}; | |
document.body.appendChild(s); | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment