zhongping_
2015-04-18 13:07
ajQuery.fn = ajQuery.prototype = { name: 'aaron', init: function() { console.log(this) }, constructor: ajQuery } 为什么输入的是 aQuery.fn.aQuery.init {} 如果去掉 aQuery.fn= 就是 aQuery.init ?
ajQuery.fn和ajQuery.prototype指向同一个原型对象,fn比prototype省略了7个字母,使用次数越多这样做的好处就体现出来了。aQuery.fn.aQuery.init {}这样的写法是错误的,aQuery.fn.init {}和ajQuery.prototype.init {}是一回事
jQuery源码解析(架构与依赖模块)
84041 学习 · 290 问题