Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 28, 2012 07:10 PM by sean freeman
Member
222 Points
338 Posts
Apr 27, 2012 07:43 PM|LINK
I see some AJAX code with a $ around functions like below. What does that do? Are there more new tricks like that in Javascript and where can I find a tutorial?
$(function() {
// do something
}
);
Contributor
2086 Points
470 Posts
Apr 27, 2012 07:46 PM|LINK
Its using jQuery..
2066 Points
416 Posts
Apr 27, 2012 07:58 PM|LINK
http://jquery.com/
Regards
170 Points
96 Posts
Apr 28, 2012 07:10 PM|LINK
you know every variable has it's own name, right?
in javascript, '$' is a variable name. it's not a trick or anything. it is not different from anyother variable name.
the thing is, some ajax libraries like jquery, wanted a shorter and easily used (simple) variable name.
javascript's variable name can be started with "any character" or "$" or "_". follwed by "any character" or "$" or "_" or "any digit".
not a big deal !
DallasSteve
Member
222 Points
338 Posts
What does $ do?
Apr 27, 2012 07:43 PM|LINK
I see some AJAX code with a $ around functions like below. What does that do? Are there more new tricks like that in Javascript and where can I find a tutorial?
$(function() {
// do something}www.SteveGaines.us
Sparkers
Contributor
2086 Points
470 Posts
Re: What does $ do?
Apr 27, 2012 07:46 PM|LINK
Its using jQuery..
Gaspard
Contributor
2066 Points
416 Posts
Re: What does $ do?
Apr 27, 2012 07:58 PM|LINK
http://jquery.com/
Regards
sean freeman
Member
170 Points
96 Posts
Re: What does $ do?
Apr 28, 2012 07:10 PM|LINK
you know every variable has it's own name, right?
in javascript, '$' is a variable name. it's not a trick or anything. it is not different from anyother variable name.
the thing is, some ajax libraries like jquery, wanted a shorter and easily used (simple) variable name.
javascript's variable name can be started with "any character" or "$" or "_". follwed by "any character" or "$" or "_" or "any digit".
not a big deal !