4.26 晴
JQuery日記 2014-4.27
匿名自執行函數返回JQuery函數(factory函數返回JQuery),調用JQuery函數時($('selector', context))返回的並不是JQuery對象,而是JQuery.fn.init對象.module分支是爲了適配CommonJS的情況.
此JQuery.fn.init的原型對象和JQuery的原型對象是相同引用.
Test
console.info(jQuery.fn.init.prototype === jQuery.prototype); //true
console.info(jQuery.fn.init.prototype === jQuery.fn); //true
爲擴展JQuery.fn.init時直接向JQuery函數的原型對象添加屬性和方法後即可,有點將JQuery.fn.init對象僞裝成JQuery對象的意味。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
JQuery 之Ajax 示例
zrz009
2020-07-08 11:14:16
【Python成長之路】基於Flask框架開發web -- 實現”新增 “功能,並實現簡單的表格管理平臺(5)
鹏哥贼优秀
2020-07-08 06:35:52
w3school學習3-jQuery 事件
amtea
2020-07-08 04:08:56
w3school學習6-jQuery HTML 操作
amtea
2020-07-08 04:08:56
w3school學習1-jQuery 語法
amtea
2020-07-08 04:08:56
JQuey基礎案例
Duplicity.
2020-07-07 20:03:57
Using JQuery to manipulate HTML label
Two ways manipulating HTML label using JQuery: 1. $("Label_Name"); 2. $('#Label_Id_Name');
lihongye_10
2020-07-07 06:44:23
WdatePicker的使用說明
yy910308
2020-07-06 19:06:14
使用 JQuery 返回頁面頂部
快雪时晴天
2020-07-06 18:49:45
自己用jquery寫的仿w3cschool的"試…
DannyZheng
2020-07-06 13:47:01
JQuery庫BootStrap框架完整模板.html
乔洪涛
2020-07-06 06:45:44
jQuery HashTable
jQuery.Hashtable = function() { 02 this.items = new Array(); 03 this.itemsCount = 0; 04 this
iteye_18400
2020-07-06 06:30:02
jQuery選擇器示例
iteye_18400
2020-07-06 06:30:02