-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jQuery整体架构-核心功能函数揭秘 #1
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
2.1.1 jQuery整体架构-核心功能函数揭秘
jQuery无new构建实例
无new化构建:
$ 就是jQuery的别称
$() 就是在创建jQuery的实例对象
举个简单的例子:
使用自执行函数将$符挂载到Window对象上
共享原型
举个简单的例子:
jQuery prototype上的init方法和jQuery共享原型对象
extend源码解析
demo.html:
jQuery.1.0.1.js:
注意:
extend第一个对象的数据类型必须是Object
extend方法在只有一个参数时参数类型必须是对象
new 一个实例 (var j = new jQuery())
1).创建一个空对象
2).调用本身的构造函数
The text was updated successfully, but these errors were encountered: