I want a variable like $ that is sort of special, but I'm already using jQuery, so $ is taken.
5 Answers
Unfortunately, older javascript supports letters, numbers, underscores, and $ in identifiers. In javascript 1.5 and later you can use Unicode characters, but that would be a very bad idea as they can be a pain to enter into most editors, and certainly aren't something you would want to have to type very often.
1 Comment
Nosredna
That's the source I was looking at. :-)
If you want a special variable like $ but $ is already taken by jQuery, why not use something that starts with $, like $a or similar? Just make sure it's one that jQuery doesn't also define.
1 Comment
Ionuț G. Stan
jQuery can handle
$ conflicts, so $ could be just fine. After all, jQuery borrowed the dollar from prototype.js