$ and $ () jQuery

I can understand what $()a jQuery object is, but what is it $? for example $.fn.eachand $.each.

I am confused here.

+3
source share
4 answers

$and jQueryis a function that contains properties.

JQuery source contains string

window.jQuery = window.$ = jQuery

It establishes $and jQueryto refer to the same object (which is a function)

The source also sets the properties of this object, for example

jQuery.each = function(...) { ... };
+6
source

This post should explain this, in particular this comment: Note. By default, jQuery uses "$" as the shortcut for "jQuery".

+2
source

$ jQuery, . $(...), . JavaScript, - $.fn $.each - .

+1

jQuery $ jQuery. $()                 JavaScript, ,                 .                , $ jQuery jQuery                .

Learning JQuery.

, .:)

0

Source: https://habr.com/ru/post/1791556/


All Articles