Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript language and the $ in jquery

I was wondering, how does the $. in $.ajax({...}); work? it doesnt make sense to me. Sure .ajax as a member make sense but $ isnt a variable name? or is it? How is it defined?

like image 743
An employee Avatar asked Sep 22 '09 12:09

An employee


1 Answers

$ is the same as jQuery. That is, you can write jQuery.ajax(...) etc.

The confusing part is $ is a legal character in Javascript variable names. It doesn't have any special meaning, as it does in PHP or Perl, for instance.

like image 102
Eli Krupitsky Avatar answered Sep 21 '22 06:09

Eli Krupitsky