I have something simple like this:
$(selector).append("somestuff");
But since I\'m going to reuse the selector I cache it with:
In this case, $selector
is an example of Hungarian notation. It is there so that you know that $selector
is a jQuery object.
If you make it your custom to always have jQuery objects start with $
if you suddenly use one wrong it will look wrong which will help you find a problem in your code.
The language couldn't care less. They could have just as well named the jQuery function J
or anything else; the $
is not a special symbol.