Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does $.functionName(); mean in javascript?

I am not familiar with this syntax. What does the $. mean before the function call?

like image 510
user840930 Avatar asked Dec 13 '22 03:12

user840930


2 Answers

$ is just a name of some object. It could be jQuery, or Prototype, in case you're using one of these libraries.

So $.functionName() simply stands for calling a function named functionName of the object named $.

like image 121
Dmytro Shevchenko Avatar answered Dec 24 '22 07:12

Dmytro Shevchenko


Over here $ sign can be replaced with "jQuery " keyword.

$.functionName();

is the same as

jQuery.functionName();

if you are using jQuery framework. If using something else, it may refer to base object as in jQuery.

like image 43
SadullahCeran Avatar answered Dec 24 '22 07:12

SadullahCeran