amateur
amateur

Reputation: 44605

$. function signature in jquery

In jquery, what does the following notation mean

$.function

Is it to show a function is globally available?

Upvotes: 3

Views: 1057

Answers (3)

kieran
kieran

Reputation: 2312

This function behaves just like $(document).ready(), in that it should be used to wrap other $() operations on your page that depend on the DOM being ready. While this function is, technically, chainable, there really isn't much use for chaining against it.

$ is basically a way to call the jQuery class.

Upvotes: 1

aularon
aularon

Reputation: 11110

No, in jQuery, the jQuery object, is aliased as $ as well, so instead of writing:

jQuery.doSomething();

you can write

$.doSomething();

Upvotes: 0

Powerlord
Powerlord

Reputation: 88796

$ is an alias to the jQuery object, so $.function is the same as calling jQuery.function.

Edit: It also applies to the jQuery method.

Upvotes: 9

Related Questions