I know exactly what you are thinking: this
post is about money. NOPE! It sure isn't :) This post has nothing to do
with money and everything to do with JavaScript.
The
dollar sign has started to pickup use in the JavaScript world lately.
In most cases the dollar sign, in JavaScript, represents a class. For
jQuery, $ represents the jQuery class as defined in their source code.
Here is an example. You can do either of these:
jQuery("#result").html("Hello World");
$("#result").html("Hello World");
Both
of those do the exact same thing; they both make the element with the
results ID have the inner HTML of Hello World. The $ is useful in
cutting down your JavaScript code by not having to write jQuery,
Prototype, or mootools every 10 seconds.
The W3C (WWW
Conference) and JavaScript traditionalists doesn't like this one bit!
According to them, it isn't "standard compliant". They do have a
point... there can be conflicts when using multiple JavaScript
libraries. But that can be fixed... just use 1 JavaScript library.
So
use the dollar sign if you want... or use the actual class name. Either
way, your JavaScript framework will just work wonders!
NOTE: This was a previous post from my other blog, http://blogs.eagleenvision.net.