Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bookmarklet to add jQuery to the current document
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
You can’t perform that action at this time.