$ versus $ (or "Battle of the JavaScript Libraries")

Anyone familiar with recent trends in JavaScript as it relates to web development has probably heard of either jQuery or Prototype.

They're both very useful JavaScript libraries. I've done a little tinkering over the weekend, and I think that jQuery looks to be my favorite of the two. I've gone so far as to install jQuery in this WordPress theme and do a little tinkering. My first demo is very simple, but easy to implement: hover over any link in the meta-information above this post, and you'll see a gradual fade in the color from a lighter grey back to the original.

As I went to integrate this simple sample into my blog code, however, I discovered one of the greatest fundamental clashes in the JavaScript library landscape: both libraries use $ as the name of their default do-it-all selection function, and Prototype was already installed as part of this theme.

So for tonight, I leave you with the example that I found - I hope that it will prevent you from bashing your head against the wall if you're trying to mess around with jQuery on your page that already includes Prototype.

http://docs.jquery.com/Using_jQuery_with_Other_Libraries describes the problem and all the solutions in a nutshell. For now, I'm just using jQuery.noConflict() and calling jQuery() rather than $(), but I may change to use one of the other methods.