首页 > Web开发 > 详细

jquery源码笔记

时间:2015-05-25 20:15:17      阅读:126      评论:0      收藏:0      [点我收藏+]

1、jquery初始化

function jQuery() {
    return new jQuery.prototype.init();
}

jQuery.prototype.init = function () {}
jQuery.prototype.css = function () {}

为啥链式运动可以直接调用呢?
jquer().css()
是因为
jquery增加了这一句:
function jQuery() {
    return new jQuery.prototype.init();
}

jQuery.prototype.init = function () {}
jQuery.prototype.css = function () {}
jQuery.ptotype.init.prototype = jQuery.prototype;
这样init的prototype就引用了jQuery.prototype

  

jquery源码笔记

原文:http://www.cnblogs.com/labihua/p/4528651.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!