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

對于函數(function($){})(),我看到里面有jQuery這個詞

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

問題描述

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

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

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

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);

括號中的那個jquery是做什么的?如果括號本身已經調用了函數,那我們?yōu)槭裁葱枰莻€ 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?

推薦答案

是一個簡單的函數調用,jQuery對象作為參數發(fā)送給匿名函數,例如:

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");

這是定義插件的常用模式,基本上允許您在匿名函數范圍內將jQuery對象引用為$,即使jQuery運行在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.

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

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

相關文檔推薦

jQuery/JavaScript Library for avatar creation?(用于創(chuàng)建頭像的 jQuery/JavaScript 庫?)
How to do following mask input problem?(如何做以下掩碼輸入問題?)
Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 設置值/標簽的問題)
how to unit-test private methods in jquery plugins?(如何對 jquery 插件中的私有方法進行單元測試?)
stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 為垂直滾動網站配置偏移量/對齊元素?)
jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽輸入插件.當文本框獲得焦點時選擇所有內容)
主站蜘蛛池模板: 午夜亚洲| 国产精品国产a | 91看片网 | 日韩一二三区 | 免费观看毛片 | 99精品视频在线观看 | 9久久 | 国产精品九九 | 成人国产精品久久 | 91精品入口蜜桃 | 久久99蜜桃综合影院免费观看 | 日韩免费网站 | 国产成人精品一区二区三 | 亚洲免费av一区 | 亚洲精品成人av久久 | av一级久久| 久久九九99 | 成人日韩 | 日韩欧美一区二区三区四区 | 日韩a| 黑人中文字幕一区二区三区 | www.黄色片视频 | 国产成人网| 久久久一二三 | 国产视频在线一区二区 | 日日摸日日碰夜夜爽2015电影 | 亚洲天堂男人的天堂 | 亚洲最大成人综合 | 91视在线国内在线播放酒店 | 亚洲一二三区免费 | 久久久久久91 | 久草热在线 | 一区二区三区四区在线视频 | 成人区精品一区二区婷婷 | 在线欧美 | 日韩成人高清在线 | 亚洲精品成人网 | 一级黄在线观看 | 日韩一区二区三区四区五区六区 | 欧美一区二区在线播放 | 国产精品久久久久免费 |