3 回答

TA贡献1735条经验 获得超5个赞
(function(){})()
1. (2. function(){}3. )4. ()
1. function(){ .. }2. (1)3. 2()
(function(doc){ doc.location = '/';})(document);//This is passed into the function above
$.fn

TA贡献1815条经验 获得超10个赞
(function(){...})()
(function($) { ...})(jQuery);
jQuery
$
jQuery.fn
jQuery.fn
jQuery.fn
.

TA贡献1797条经验 获得超6个赞
一点帮助:
// an anonymous function
(function () { console.log('allo') });
// a self invoked anonymous function
(function () { console.log('allo') })();
// a self invoked anonymous function with a parameter called "$"
var jQuery = 'I\'m not jQuery.';
(function ($) { console.log($) })(jQuery);
添加回答
举报