神奇的jQuery可以这样玩
jQuery("#id").css()或 jQuery("#id").html() 这么玩
jQuery("#id")这个对象是怎么创建出来的 所以打算来扒一扒

 

//jquery源码部分
var jQuery = function(){
  return new jQuery.fn.init();
}

//构造函数的原型给了fn
jQuery.fn = jQuery.prototype = {

}

jQuery.fn.init = function(){

}

var init = jQuery.fn.init

init.prototype = jQuery.fn;

根据以上东西

推出这么一个表达式

jQuery.protype.init.protype = jQuery.protype

相信懂原型的朋友应该看明白了(不懂得在学习一下)

下面上分析图jQuery源码学习扒一扒jQuery对象初使化

 

相关文章:

  • 2021-01-30
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2021-10-03
  • 2021-09-03
  • 2021-08-05
  • 2021-08-22
猜你喜欢
  • 2021-08-26
  • 2021-09-29
  • 2021-07-28
  • 2021-09-29
  • 2022-02-06
  • 2022-02-17
相关资源
相似解决方案