jQuery源码解读2 - 整体架构1,整体使用了一个匿名函数作为jQuery的命名空间,代码如下:jQuery.fn jQuery.
jQuery源码解读2 - 整体架构
1,整体使用了一个匿名函数作为jQuery的命名空间,代码如下:
jQuery.fn = jQuery.prototype = {} 将jQuery.fn又指向jQuery.prototype
最终,使用jQuery("div")调用的函数是第102行代码
jQuery源码解读2 - 整体架构
1,整体使用了一个匿名函数作为jQuery的命名空间,代码如下:
jQuery.fn = jQuery.prototype = {}