Javascript function column name

I have two JavaScript files that contain a jQuery function with the same name $ ().

How can I distinguish between two equally named functions?

+5
source share
4 answers

Rename it.

$ = typeof $ !== 'function' ? $ : $foo;
+1
source

Short answer: you cannot. All js files live in the same namespace.

+2
source

, jQuery , , . , , ?

0

, . , , dosomething(), myproject.dosomething()

Thus, this is a specific project, and you will avoid having two identically named functions, even if you include files that you did not develop yourself.

0
source

All Articles