In JavaScript (function ($) {...}) What is the meaning of the (jQuery) notation?
======================================================================//This is a split line.
first function (ARG) {
//....
}
This form is called an anonymous function in JavaScript. ARG is the parameter of the anonymous function.
and (function ($) {
}) (jquery), which is a form of executing an anonymous function and passing the parameter jQuery.
=========================================================================//This is a split line
is actually equivalent to
var func = funtion ($) {
//.....
};
Func (JQuery);
============================================================================//This is a split line
In
fact, these two kinds of writing is a meaning. It's just a straight-up form.
(function ($) {...}) (jQuery)
JavaScript (function ($) {...}) What do you mean by (jQuery)?