Here is a slight modification to Joan Piedra’s jQuery greasemonkey script that loads the jQuery library on any page you visit. This gives you the power of jQuery when using Firebug or Greasemonkey. Here is an example of its usage.
var jQueryDefinition = (function() {/*jQuery library*/});
var GM_JQ = document.createElement('script');
GM_JQ.innerHTML = '(' + jQueryDefinition.toString() + ')();';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);
Here is the full script.
Here is the userscrips page.
Make sure that the jquery.user.js script is loaded before any other dependent Greasemonkey scripts.
The difference is you can put the jQuery library into the script itself. This causes the page to load faster and does not use up John Resig’s bandwidth. Unfortunately, this also means you will need to manually upgrade your greasemonkey script when the next version of jQuery comes out.
[Update] Edited the Greasemonkey script to make jQuery compatible with other js libraries.
[Update] Pointing to userscripts.org
Differences noted. This should help me with my scripts more. The greasemonkey tags are very useful.
February 28, 2008 at 12:47 pm
Awesome brian, just what i needed for a greasemonkey script for one webgame called ikariam, and i didnt want to use nude javascript to do it, so hard… Jquery rulez
October 30, 2008 at 1:37 am