What is $ .functionName (); mean in javascript?

I am not familiar with this syntax. What does it mean $.before calling a function?

+3
source share
5 answers

$is just the name of some object. It can be jQuery or Prototype if you use one of these libraries.

So, it $.functionName()simply means calling a function with the name of an functionNameobject with a name $.

+6
source

Here the $ sign can be replaced with the keyword "jQuery".

$.functionName();

coincides with

jQuery.functionName();

if you are using jQuery framework. If you use something else, it can refer to the underlying object, as in jQuery.

+3
source

- document.getElementById().

http://osric.com/chris/accidental-developer/2008/04/the-javascript-dollar-sign-function/

Jquery, Mootools javascript.

function $(obj) {
    return document.getElementById(obj);
}
+2

$- , $ JavaScript. - , "functionName" . (, jQuery), , , , .

+1

All Articles