Jump to content
Larry Ullman's Book Forums

Recommended Posts

Sorry for the confusion. I don't think I use $() before (or in) Chapter 7, do I? In any case, that's just a terse name given to a user-defined function that makes for easy use. The function's name is $ and the () are the execution of that function.

 

This is what jQuery does for its main function. 

Link to comment
Share on other sites

The first time I ever saw $ (for me, it was in the context of using jQuery), I was equally confused until I realized that $ is nothing more than just another variable name in JS.

 

Just like a, b, or J, $ is a valid variable name, and it was originally adopted as the short name for calling the jQuery function because it's only one character (thus quick to type), and at that time, $ wasn't really used by anything else, thus it was a pretty unique variable name that was easy to remember.

Link to comment
Share on other sites

 Share

×
×
  • Create New...