jquery 2.0.3 源码学习笔记(二)
2016-12-18 00:00
357 查看
一、为啥不推荐使用"use strict"
1、兼容性问题,低版本浏览器不支持
二、jQuery(document)为啥赋值给rootjQuery
1、方便压缩
2、便于阅读,可维护
三、typeof undefined
1、兼容旧版本浏览器
四、class2type作用
1、$.type() 检测obj的数据类型。
五、jQuery对象的隐式初始化
1、一般的对象初始化
function A(){
}
A.prototype.init =function(){};
A.prototype.css= function(){};
var a=new A();
a.init()
a.css();
2、jQuery的对象初始化
function jQuery() {
return new jQuery.prototype.init();
}
jQuery.prototype.init=function(){};
jQuery.prototype.css=function(){};
jQuery.prototype.init.prototype=jQuery.prototype;
jQuery().css();
1、兼容性问题,低版本浏览器不支持
二、jQuery(document)为啥赋值给rootjQuery
1、方便压缩
2、便于阅读,可维护
三、typeof undefined
1、兼容旧版本浏览器
四、class2type作用
1、$.type() 检测obj的数据类型。
五、jQuery对象的隐式初始化
1、一般的对象初始化
function A(){
}
A.prototype.init =function(){};
A.prototype.css= function(){};
var a=new A();
a.init()
a.css();
2、jQuery的对象初始化
function jQuery() {
return new jQuery.prototype.init();
}
jQuery.prototype.init=function(){};
jQuery.prototype.css=function(){};
jQuery.prototype.init.prototype=jQuery.prototype;
jQuery().css();
相关文章推荐
- jquery 2.0.3 源码学习笔记(一)
- jquery 2.0.3 源码学习笔记(三)构造器
- jquery 2.0.3 源码学习笔记(三)类数组
- jQuery源码学习笔记九
- jQuery源码学习笔记十(改)
- jquery2.0.3动画(animate)源码解读与javascript基本知识学习一
- jQuery源码研究分析学习笔记-jQuery原型属性和方法(九)
- jQuery源码研究分析学习笔记-jQuery.fn.init()(五)
- jQuery源码分析研究学习笔记-jQuery.clean()(七)
- jQuery源码学习笔记五(转)
- 菜鸟的jQuery源码学习笔记(前言)
- jquery源码学习笔记一:总体结构
- jQuery源码学习笔记一(转)
- jQuery 入门级学习笔记及源码
- jquery源码学习笔记一:总体结构
- jquery源码学习笔记
- 菜鸟的jQuery源码学习笔记(三)
- jQuery源码学习笔记:总体架构
- jQuery源码研究分析学习笔记-jQuery.buildFragment()(六)
- jquery源码学习笔记二:jQuery工厂