Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What does $("a") or $(document)really do? How did they define it?(I know it's a $ function)

I am just going through the jQuery by myself. I found the jQuery syntax is very peculiar, and not well defined. ( I guess most people just try to remember the why the jQuery requires everyone to do) Can anyone shed some light on the why jQuery does what it does.



Thanks!
Posted

1 solution

Unlike other similar languages, in JavaScript the dollar sign ('$') is a character which can be used as a part of name, pretty much like any letter or underscore. So, a name can start with this character or contain just one dollar character. This character is often used in jQuery.

See http://www.authenticsociety.com/blog/JavaScript_DollarSign[^], http://www.authenticsociety.com/blog/WhatisjQuery_Part1[^].

—SA
 
Share this answer
 
Comments
tryharder 16-Nov-11 16:28pm    
I got the answer by myself. $() is jQuery class contructor. $ is alias of jQuery class. But I still have questions inside the each() with $(this) and this only. I tested they are diffent. Can someone explain to me why they are different?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900