zl程序教程

您现在的位置是:首页 >  前端

当前栏目

jquery 源码剖析1

jQuery源码 剖析
2023-09-11 14:18:04 时间

()();   闭包,让声明的变量变成局部变量,使外部无法访问,防止和其他代码冲突,互不影响。

 

(function(){

})();              和一般执行方法一样的。

 

jQuery=function(){

  return new jQuery.prototype.init();

}

    jQuery.init=function(){ } 

   jQuery.css=function(){}

//这句是重点 使得下面 jQuery() 返回的 具有 原型css方法

 jQuery.prototype.init.prototype=jQuery.prototype;

 

jQuery().css();