I'm just developing my own mini framework for an application I was working on, and I've been studying the jQuery is coded.
I get the way $(selector).function() works, but how come you can call some functions such as:
$.ajax()
Surely this would been the dollar symbol references both a function and the jquery.fn object at the same time?
Thanks in advance!
Functions are objects in JavaScript so they can have properties.
$
is the jQuery object, when using $()
it is used as a constructor (it contains some magic so new
is not necessary); but it also contains lots of methods (and some non-callable properties such as $.browser
) available as $.something
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With