Thursday, March 13th, 2008 at 8:45 PM
While developing web applications at my day job, I've come to rely quite heavily on the jQuery JavaScript library. In fact, it's the client-side backbone upon which our company software is built. It comes as no surprise, then, that I sometimes find myself poking around in others' web application code with Firebug (or Widerbug) and wishing I had jQuery at my immediate disposal to perform manipulations with its succinct syntax and practical API.
A day ago, I stumbled upon the answer I was looking for on the Learning jQuery blog: a browser-ready jQuery-loading bookmarklet. For the uninitiated, a bookmarklet is a standard bookmark placed in your Bookmarks Bar, except it runs some JavaScript code instead of pointing your browser at a web destination. In this case, the bookmarklet manually fetches and inserts jQuery into the current page. I've modified the following version slightly to flash "jQuery Loaded" on the page when the load is complete, using the just-loaded jQuery, naturally.
To install the tool, just drag the following link to your Bookmarks Bar, and click it to temporarily install jQuery on whatever page you're visiting: jQueryize
Or, if you prefer to copy-and-paste, here is the code:
javascript:void(function(){var s=document.createElement('script'); s.src='http://code.jquery.com/jquery-latest.js';s.onload=function(){var h=$('jQuery Loaded');h.css({backgroundColor:'red',border:'5px solid white',color:'white',fontSize:'24px', fontWeight:'bold',fontFamily:'Verdana, sans-serif',position:'fixed',top:'100px',left:'100px;', padding:'10px'});$('body').append(h);h.fadeOut(1000,function(){h.remove();});}; document.getElementsByTagName('head')[0].appendChild(s);}())
This entry was posted on Thursday, March 13th, 2008 at 8:45 pm and is filed under NerdLab, Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.



fmTuner: Last.fm for WordPress
ADB Mouse Conversion
iPod Super