现在的位置: 首页 > 综合 > 正文

professional javascript for web developers 2nd_edition读书笔记(一)

2012年04月04日 ⁄ 综合 ⁄ 共 1570字 ⁄ 字号 评论关闭


 

第一章


JavaScript

是什么


1

JavaScript

的历史:


        

In 1997, JavaScript 1.1

was submitted to the European Computer Manufacturers Association

(Ecma)

as a proposal. Technical
Committee #39 (TC39) hammer out ECMA -
262

, a standard defining a new scripting language named

ECMAScript.

2

JavaScript
Implementations


        

Indeed, a complete
JavaScript implementation is made up of the following three distinct parts :

n  

The Core (ECMAScript

)

n  

The Document Object
Model (DOM)

n 

The Browser Object
Model (BOM)


3

ECMAScript


ECMAScript

ECMA – 262

定义的语言

)并不依赖于

web

浏览器(

web

浏览器是只是

host environment

);

host environment

提供了

ECMAScript

和他的扩展(如

DOM

,利用

ECMAScript

的核心类型和语法来提供特别的功能)的基本实现。其他的

host environment

还有

ScriptEase

Adobe Flash.

4

The
Document Object Model ( DOM )


        

The Document Object
Model ( DOM )

是一种面向

xml

应用程序接口,现扩展为

html

DOM

将整个

page

指定成一个

node

层次结构。

HTML or XML page

的每一部分是一个

node

node

内包含数据)。

5

DOM
Levels

DOM Level 1

98

年十月成为

W3C recommendation

)包含有两个模块:

DOM CORE

(主要针对

xmldocument

DOM Html

(扩展了

DOM CORE

,增加了针对

html

的对象和方法)。

DOM Level 2

扩展了

DOM,

增加了如下支持:

support for mouse and
user – interface events

ranges, traversals (methods to iterate over a DOM
document), and support for Cascading Style Sheets (CSS) through object interfaces

6

The
Browser Object Model ( BOM )

a Browser Object Model (BOM)

可访问和操作

the browser window.

利用

BOM, developers can
interact with the browser outside of the context of its displayed page.

BOM

处理

the browser window
and frames,

通常

JavaScript

基于浏览器的的一些扩展被看做

BOM

的一部分。如:

n  

弹出一个新的浏览器窗口。

n  

移动,调整,关闭浏览器窗口。

n  

navigator

对象,提供了浏览器的详细信息。

n  

location

对象,提供了加载页的详细信息。

n  

screen

对象,提供了

the user ’ s screen
resolution upport for cookies

n  

定义对象如:

XMLHttpRequest

Internet Explorer ’
s ActiveXObject

 

BOM

没有公共标准,每个浏览器的都有各自的

BOM

实现。

BOM

存在一些事实上的标准,比如

window

对象和

navigator

对象,不同的浏览器都有各自的属性和方法。

 

抱歉!评论已关闭.