久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

對(duì)于函數(shù)(function($){})(),我看到里面有jQuery這個(gè)詞

For the function (function($){})(), I#39;ve seen it with the word jQuery in it, why is that?(對(duì)于函數(shù)(function($){})(),我看到里面有jQuery這個(gè)詞,這是為什么呢?)
本文介紹了對(duì)于函數(shù)(function($){})(),我看到里面有jQuery這個(gè)詞,這是為什么呢?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

對(duì)于函數(shù)(function($){})(),我看到里面有jQuery這個(gè)詞,這是為什么呢?

For the function (function($){})(), I've seen it with the word jQuery in it, why is that?

我已閱讀此頁(yè)面 Javascript:為什么 jQuery 會(huì)這樣做:(function(){ ...});,它是如何工作的? 但它沒(méi)有說(shuō)明這樣的示例:

I have read this page Javascript: why does jQuery do this: (function(){ ...});, and how does it work? but it didnt tell about an example like this:

(function($){})(jQuery);

括號(hào)中的那個(gè)jquery是做什么的?如果括號(hào)本身已經(jīng)調(diào)用了函數(shù),那我們?yōu)槭裁葱枰莻€(gè) jQuery 呢?

What does that jquery in the parenthesis do? If the parenthesis by itself already self calls the function then why do we need that jQuery in there?

推薦答案

是一個(gè)簡(jiǎn)單的函數(shù)調(diào)用,jQuery對(duì)象作為參數(shù)發(fā)送給匿名函數(shù),例如:

Is a simple function invocation, the jQuery object is sent as an argument to the anonymous function, e.g.:

(function (foo) {
  alert(foo); // alerts "hello"
})("hello");

這是定義插件的常用模式,基本上允許您在匿名函數(shù)范圍內(nèi)將jQuery對(duì)象引用為$,即使jQuery運(yùn)行在noConflict 模式.

It's a common pattern to define plugins, basically permits you to reference the jQuery object as $ in the scope of the anonymous function, even if jQuery is running in noConflict mode.

這篇關(guān)于對(duì)于函數(shù)(function($){})(),我看到里面有jQuery這個(gè)詞,這是為什么呢?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

jQuery/JavaScript Library for avatar creation?(用于創(chuàng)建頭像的 jQuery/JavaScript 庫(kù)?)
How to do following mask input problem?(如何做以下掩碼輸入問(wèn)題?)
Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 設(shè)置值/標(biāo)簽的問(wèn)題)
how to unit-test private methods in jquery plugins?(如何對(duì) jquery 插件中的私有方法進(jìn)行單元測(cè)試?)
stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 為垂直滾動(dòng)網(wǎng)站配置偏移量/對(duì)齊元素?)
jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽輸入插件.當(dāng)文本框獲得焦點(diǎn)時(shí)選擇所有內(nèi)容)
主站蜘蛛池模板: 国内精品久久久久 | 黄色片网站在线观看 | 久久综合伊人77777蜜臀 | 国产欧美日韩在线观看 | 日韩av免费看 | 欧美 日韩 国产 成人 在线 | 男男巨肉啪啪动漫3d | 国产成人97精品免费看片 | 黄色1级视频 | 欧美在线激情 | 亚洲综合免费 | 密乳av| 日本亚洲欧美 | 91欧美激情一区二区三区成人 | 色吧五月天 | 免费黄网站在线观看 | 欧美vieox另类极品 | 久久久不卡| 色哥网| 一级视频网站 | 在线观看av不卡 | 国产伦精品一区二区三区免费视频 | 一级黄色大片 | 久久精品国产77777蜜臀 | 亚洲最新av | 亚洲午夜18毛片在线看 | 久久中文字幕视频 | 日本大尺度床戏揉捏胸 | 福利片在线观看 | 在线观看黄色小说 | 黄骗免费网站 | 国产精品无遮挡 | 日本天天操 | 黄色精品视频 | 性生活网址| 日本一级淫片色费放 | 亚洲最新视频 | 黄色三级视频在线观看 | 中文字幕网址在线 | 中文字幕永久免费 | 国产成人精品亚洲 |