-
-
Save mt3/3926204 to your computer and use it in GitHub Desktop.
Simple bookmarklet template with jQuery
This file contains hidden or 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
// Stripped down jQuerify for modern browsers: http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet | |
(function() { | |
var f = function() { | |
jQuery.noConflict()(function($) { | |
// Bookmarklet code goes here | |
}); | |
}; | |
if (typeof jQuery != 'undefined') { | |
f(); | |
} else { | |
var head = document.getElementsByTagName('head')[0]; | |
var script = document.createElement('script'); | |
script.src = 'http://code.jquery.com/jquery-latest.min.js'; | |
script.onload = function() { | |
f(); | |
head.removeChild(script); | |
}; | |
head.appendChild(script); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment