出版时间:2011-1 出版社:东南大学出版社 作者:David Flanagan 页数:1078
Tag标签:无
内容概要
本书是一本针对JavaScript语言的核心内容以及由浏览器定义的客户端JavaScript应用程序编程接口的程序员指南和综合参考书。
本书第6版涵盖了HTML 5和ECMAScript
5。为了介绍当今Web开发的最佳实践,很多章节被完全重写过。这一版新添加的章节详细讲解了jQuery和服务器端JavaScript编程。
此书推荐给那些想学习Web编程技巧的有经验的程序员,以及那些想要精通这门语言的JavaScript程序员。
作者简介
作者:(美国)弗拉纳根(David Flanagan) David Flanagan也是《The Ruby Programming》、《Java in a Nutshell》和《JavaScript Pocket Reference》的作者。
书籍目录
Preface
1.Introduction to JavaScript
Part I.Core JavaScript
2.Lexical Structure
3.Types, Values, and Variables
4.Expressions and Operators
5.Statements
6.Objects
7.Arrays
8.Functions
9.Classes and Modules
10.Pattern Matching with Regular Expressions
11.JavaScript Subsets and Extensions.
12.Server-Side JavaScript.
Part II.Client-Side JavaScript
13.JavaScript in Web Browsers
14.The Window Object,
15.Scripting Documents
16.ScriptingCSS.
17.Handling Events
18.Scripted HTTP,
19.The jquery Library
20.Client-SideStorage.
21.Scripted Media and Graphics
22.HTML5 APIs
PartIII.CoreJavaScript Reference
Core JavaScript Reference
Part IV.Client-Side JavaScript Reference
Client-Side JavaScript Reference
Index
章节摘录
版权页: 插图: Many classes define more specific versions of the toString() method. The toString() method of the Array class, for example, converts each array element to a string and joins the resulting strings together with commas in between. The toString() method of the Function class returns an implementation-defined representation of a function. In practice, implementations usually convert user-defined functions to strings of Java-Script source code. The Date class defines a toString() method that returns a humanreadable (and JavaScript-parsable) date and time string. The RegExp class defines a toString() method that converts RegExp objects to a string that looks like a RegExp literal:The other object conversion function is called value0f(). The job of this method is less well-defined: it is supposed to convert an, "ject to a primitive value that represents the object, if any such primitive value exists. Objects are compound values, and most objects cannot really be represented by a single primitive value, so the default valueOf() method simply returns the object itself rather than returning a primitive. Wrapper classes define value0f() methods that return the wrapped primitive value. Arrays,functions, and regular expressions simply inherit the default method. Calling valueOf() for instances of these types simply returns the object itself. The Date class defines a valueOf() method that returns the date in its internal representation: the number of milliseconds since January 1, 1970: With the toString() and valueOf() methods explained, we can now cover object-to-string and object-to-number conversions. Do note, however, that there are some special cases in which JavaScript performs a different object-to-primitive conversion. These special cases are covered at the end of this section. To convert an object to a string, JavaScript takes these steps: If the object has a toString() method, JavaScript calls it. If it returns a primitive value, JavaScript converts that value to a string (if it is not already a string) and returns the result of that conversion. Note that primitive-to-string conversions are all well-defined in Table 3-2. If the object has no toString() method, or if that method does not return a primitive value, then JavaScript looks for a valueOf() method. If the method exists, Java-Script calls it. If the return value is a primitive, JavaScript converts that value to a string (if it is not already) and returns the converted value. Otherwise, JavaScript cannot obtain a primitive value from either toString() or valueOf(), so it throws a TypeError.
编辑推荐
《JavaScript权威指南(影印版)(第6版)(套装共2册)》是一本专家级JavaScript程序员的必备参考,结构合理,深入细节。涵盖了HTML5和ECMAScript5。对于所有JavaScript开发人员都是不可或缺的一本参考书。
名人推荐
从1996年起,《JavaScript权威指南》就一直是JavaScript程序员的圣经。尽管已经印刷了五十多万册,网络开发人员仍然对本书赞不绝口: “一本专家级JavaScript程序员的必备参考……结构合理,深入细节。” ——Brendan Eich JavaScript的发明人,Mozilla首席技术官 “从《JavaScript权威指南》中学到的东西让我开创了自己的事业。” ——Andrew Hedges Tapulous “《JavaScript权威指南》教给了我JavaScript。” ——Tbm Robinson 280 North共同创始人,Cappuccino共同发明人 “我知道JavaScript的哪些部分比较重要,从我那本《JavaScript权威指南》的书脊上某一区域的发皱程度就可以分辨出来。” ——J.Chris Anderson CouchBase的共同创始人,Apache CouchDB代码贡献者, 《CouchDB:The Deftnitive Guide》作者 “……对于所有JavaScript开发人员都不可或缺的一本参考书。如果我需要了解关于JavaScript的某个知识,我相信《JavaScript权威指南》会为我提供正确的答案。它就是这么棒。” ——Rey Bango 微软Clien—Web社区项目经理和jQuery团队成员
图书封面
图书标签Tags
无
评论、评分、阅读与下载