Someone recently asked if it was possible to somehow include jQuery in Firebug for testing jQuery code on web pages that don't already have it included.
It's not only possible to include the jQuery source right from the Firebug console, but you can also add a bookmarklet to your Bookmarks toolbar for one-click jQuery action!
Here is an example of what you could type into the Firebug console, line by line, to make a page ready for jQuery fun:[js]var s=document.createElement('script'); s.setAttribute('src','http://code.jquery.com/jquery.js'); document.getElementsByTagName('body').appendChild(s); [/js]
Or, simply drag the following link to your Bookmarks toolbar:
> jQuerify <
Also, in the bookmarklet I added an alert message that says "Thank you for using jquery" when you activate it. I wanted that in there for myself because I like knowing for sure that it's working. Feel free to pluck that part out, though, if it annoys you.
Thanks to the folks at Left Logic for their microformats bookmarklet, which inspired me to make this one. In fact, the jQuerify bookmarklet is just a subset of theirs.
Please see my entry about the
updated and improved bookmarklet .