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.fnjQuery.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);
添加回答
舉報
