jQuerify Bookmarklet

It's a nice little tool that allows you to play around with jQuery on a page that doesn't already have jQuery loaded and see the results immediately. Based on feedback from others, I've updated the bookmarklet a bit. Now, it first checks to see if jQuery is already loaded on the page and doesn't bother loading it if it's there. Also, instead of showing an alert message, it temporarily places an absolutely positioned div at the top of the page with a message saying either "This page is now jQuerified" or "This page was already jQuerified." After 2 1/2 seconds, the message fades out and is removed from the DOM. Here is what the script looks like before it is converted to bookmarklet format (replacing spaces with %20, etc.):

Source (www.learningjquery.com)


Download Bookmarklet:


View Bookmarklet Code:

Bookmarklet Source Code:

javascript%3A%28function%28%29%7Bvar%20s%3Ddocument.createElement%28%27script%27%29%3Bs.setAttribute%28%27src%27%2C%27http%3A//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js%27%29%3Bif%28typeof%20jQuery%3D%3D%27undefined%27%29%7Bdocument.getElementsByTagName%28%27head%27%29%5B0%5D.appendChild%28s%29%3B%7DjQuery%28%22td.edit%20select%20option%5Bvalue%3DBN%5D%22%29.attr%28%22selected%22%2C%22%22%29%3B%7D%29%28%29%3B


Rate it:


Tags:

Comments

Comments so far. Add yours.

Chris

When I attempt to drag this bookmarklet to my toolbar in OSX 10.6 Snow Leopard, running an up to date Chrome (15.0.874.121), it reliably and repeatedly crashes the browser.