登录 注册
当前位置:主页 > 资源下载 > 16 > JavaScript进阶教程

JavaScript进阶教程

  • 更新:2024-05-26 20:32:44
  • 大小:5.05MB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Javascript - 前端
  • 格式:PDF

资源介绍

第 1 章 JavaScript 是什么...............................................1 3 1.1 历史简述..............................................1 1.2 JavaScript 实现..............................................2 1.2.1 ECMAScript 1.2.2 DOM..............................................5 1.2.3 BOM..............................................8 1.3 小结..............................................8 第 2 章 ECMAScript 基础...............................................9 2.1 语法..............................................9 2.2 变量..............................................10 2.3 关键字..............................................12 2.4 保留字..............................................12 2.5 原始值和引用值..............................................13 2.6 原始类型..............................................13 2.6.1 typeof 运算符..............................................14 2.6.2 Undefined 类型..............................................14 2.6.3 Null 类型..............................................15 2.6.4 Boolean 类型..............................................15 2.6.5 Number 类型..............................................15 2.6.6 String 类型..............................................17 2.7 转换..............................................18 2.7.1 转换成字符串..............................................18 2.7.2 转换成数字..............................................19 2.7.3 强制类型转换..............................................20 2.8 引用类型..............................................22 2.8.1 Object 类..............................................22 2.8.2 Boolean 类..............................................23 2.8.3 Number 类..............................................23 2.8.4 String 类..............................................24 2.8.5 instanceof 运算符..............................................28 2.9 运算符..............................................28 2.9.1 一元运算符..............................................28 2.9.2 位运算符..............................................32 2.9.3 Boolean 运算符..............................................37 2.9.4 乘性运算符..............................................40 2.9.5 加性运算符..............................................41 2.9.6 关系运算符..............................................42 2.9.7 等性运算符..............................................43 2.9.8 条件运算符..............................................45 2.9.9 赋值运算符..............................................45 2.9.10 逗号运算符..............................................46 2.10 语句..............................................46 2.10.1 if 语句..............................................46 2.10.2 迭代语句..............................................47 2.10.3 有标签的语句..............................................48 2.10.4 break 语句和 continue 语句..............................................48 2.10.5 with 语句..............................................50 2.10.6 switch 语句..............................................50 2.11 函数..............................................51 2.11.1 无重载..............................................53 2.11.2 arguments 对象..............................................53 2.11.3 Function 类..............................................54 2.11.4 闭包..............................................56 2.12 小结..............................................57 第 3 章 对象基础...............................................58 3.1 面向对象术语..............................................58 3.1.1 面向对象语言的要求..............................................58 3.1.2 对象的构成..............................................59 3.2 对象应用..............................................59 3.2.1 声明和实例化..............................................59 3.2.2 对象引用..............................................59 3.2.3 对象废除..............................................59 3.2.4 早绑定和晚绑定..............................................60 3.3 对象的类型..............................................60 3.3.1 本地对象..............................................60 3.3.2 内置对象..............................................70 3.3.3 宿主对象..............................................75 3.4 作用域..............................................75 3.4.1 公用、受保护和私有作用域..............................................75 3.4.2 静态作用域并非静态的..............................................76 3.4.3 关键字 this. 76 3.5 定义类或对象..............................................78 3.5.1 工厂方式..............................................78 3.5.2 构造函数方式..............................................80 3.5.3 原型方式..............................................80 3.5.4 混合的构造函数/原型方式..............................................81 3.5.5 动态原型方法..............................................82 3.5.6 混合工厂方式..............................................83 3.5.7 采用哪种方式..............................................84 3.5.8 实例..............................................84 3.6 修改对象..............................................86 3.6.1 创建新方法..............................................86 3.6.2 重定义已有方法..............................................87 3.6.3 极晚绑定..............................................88 3.7 小结..............................................88 第 4 章 继承. 104...............................................89 100 4.1 继承机制实例..............................................89 4.2 继承机制的实现..............................................90 4.2.1 继承的方式..............................................90 4.2.2 一个更实际的例子..............................................96 4.3 其他继承方式..............................................100 4.3.1 zInherit 4.3.2 xbObjects 4.4 小结..............................................108 第 5 章 浏览器中的 JavaScript 109 5.1 HTML 中的 JavaScript 109 5.1.1