本文共 508 字,大约阅读时间需要 1 分钟。
http://www.cnblogs.com/aaronjs/p/3278578.html
1 使用使用jQuery.prototype 覆盖 jQuery.prototype.init.prototype
这样在jQuery.prototype.init.prototype 中如果找不到的属性或者非法,就会去jQuery.prototype中寻找(对象的prototype 相当于其他高级语言中的object类)
2 jQuery.name 相当于先在jQuery.prototype.init 自身对象实例中寻找 如果木有 则到父类 (即jQuery 类中了)
3 jQuery.extend 是扩展的插件接口 (里面已经包含内部扩展的一些方法) 用户可以自己扩展一些方法
jQuery.extend 对jQuery本身的属性和方法进行了扩展相当于扩展了 jQuery类方法 jQuery.fn.extend 对jQuery.fn的属性和方法进行了扩
可理解扩展jQuery 示例方法$('#id') 中this 是指 jQuery.prototype.init + jQuery.prototype中的方法