Professional JavaScript for Web Developers, 2nd Edition

0
(0)

Professional JavaScript for Web Developers, 2nd Edition
 

  • Author:Nicholas C. Zakas
  • Length: 840 pages
  • Edition: 2
  • Publisher: Wrox
  • Publication Date: 2009-01-14
  • ISBN-10: 047022780X
  • ISBN-13: 9780470227800
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Professional JavaScript for Web Developers, 2nd Edition, provides a developer-level introduction along with the more advanced and useful features of JavaScript.

    Starting at the beginning, the book explores how JavaScript originated and evolved into what it is today. A detailed discussion of the components that make up a JavaScript implementation follows, with specific focus on standards such as ECMAScript and the Document Object Model (DOM). The differences in JavaScript implementations used in different popular web browsers are also discussed.

    Building on that base, the book moves on to cover basic concepts of JavaScript including its version of object-oriented programming, inheritance, and its use in various markup languages such as HTML. An in-depth examination of events and event handling is followed by an exploration of browser detection techniques and a guide to using regular expressions in JavaScript. The book then takes all this knowledge and applies it to creating dynamic user interfaces.

    The last part of the book is focused on advanced topics, including performance/memory optimization, best practices, and a look at where JavaScript is going in the future.

    This book is aimed at three groups of readers:

    • Experienced developers familiar with object-oriented programming who are looking to learn JavaScript as it relates to traditional OO languages such as Java and C++
    • Web application developers attempting to enhance the usability of their web sites and web applications
    • Novice JavaScript developers aiming to better understand the language

    In addition, familiarity with the following related technologies is a strong indicator that this book is for you:

    • Java
    • PHP
    • ASP.NET
    • HTML
    • CSS
    • XML

    This book is not aimed at beginners who lack a basic computer science background or those looking to add some simple user interactions to web sites. These readers should instead refer to Wrox’s Beginning JavaScript,3rd Edition (Wiley, 2007).

    This book covers:

    • What Is JavaScript?—Explains the origins of JavaScript: where it came from, how it evolved, and what it is today. Concepts introduced include the relationship between JavaScript and ECMAScript, the Document Object Model (DOM), and the Browser Object Model (BOM). A discussion of the relevant standards from the European Computer Manufacturer’s Association (ECMA) and the World Wide Web Consortium (W3C) is also included.
    • JavaScript in HTML—Examines how JavaScript is used in conjunction with HTML to create dynamic web pages. Introduces the various ways of embedding JavaScript into a page, including a discussion surrounding the JavaScript content-type and its relationship to the element.
    • Language Basics—Introduces basic language concepts, including syntax and flow control statements. Explains the syntactic similarities of JavaScript and other C-based languages and points out the differences. Type coercion is introduced as it relates to built-in operators.
    • Variables, Scope, and Memory—Explores how variables are handled in JavaScript given their loosely typed nature. A discussion about the differences between primitive and reference values is included, as is information about execution context as it relates to variables. Also, a discussion about garbage collection in JavaScript explains how memory is reclaimed when variables go out of scope.
    • Reference Types—Covers all of the details regarding JavaScript’s built-in reference types, such as Object and Array. Each reference type described in ECMA-262 is discussed both in theory and how they relate to browser implementations.
    • Object-Oriented Programming—Explains how to use object-oriented programming in JavaScript. Since JavaScript has no concept of classes, several popular techniques are explored for object creation and inheritance. Also covered is the concept of function prototypes and how that relates to an overall OO approach.
    • Anonymous Functions—Explores one of the most powerful aspects of JavaScript: anonymous functions. Topics include closures, how the thisobject works, the module pattern, and creating private object members.
    • The Browser Object Model—Introduces the Browser Object Model (BOM), which is responsible for objects allowing interaction with the browser itself. Each of the BOM objects is covered, including window, document, location, navigator, and screen.
    • Client Detection—Explains various approaches to detecting the client machine and its capabilities. Different techniques include capability detection and user-agent string detection. Each approach is discussed for pros and cons as well as situational appropriateness.
    • The Document Object Model—Introduces the Document Object Model (DOM) objects available in JavaScript as defined in DOM Level 1. A brief introduction to XML and its relationship to the DOM gives way to an in-depth exploration of the entire DOM and how it allows developers to manipulate a page.
    • DOM Levels 2 and 3Explains how DOM Levels 2 and 3 augmented the DOM with additional properties, methods, and objects. Compatibility issues between Internet Explorer and other browsers are discussed.
    • Events—Explains the nature of events in JavaScript, where they originated, legacy support, and how the DOM redefined how events should work. A variety of devices are covered, including the Wii and iPhone.
    • Scripting Forms—Looks at using JavaScript to enhance form interactions and work around browser limitations. Discussion focuses on individual form elements such as text boxes and select boxes and on data validation and manipulation.
    • Error Handling and Debugging—Discusses how browsers handle errors in JavaScript code and presents several ways to handle errors. Debugging tools and techniques are also discussed for each browser, including recommendations for simplifying the debugging process.
    • XML in JavaScript—Presents the features of JavaScript used to read and manipulate eXtensible Markup Language (XML) data. Explains the differences in support and objects in various web browsers, and offers suggestions for easier cross-browser coding. This also covers the use of eXtensible Stylesheet Language Transformations (XSLT) to transform XML data on the client.
    • ECMAScript for XML—Discusses the ECMAScript for XML (E4X) extension to JavaScript, which is designed to simplify working with XML. Explains the advantages of E4X over using the DOM for XML manipulation.
    • Ajax and JSON—Looks at common Ajax techniques, including the use of the XMLHttpRequest object and Internet Explorer’s XDomainRequestobject for cross-domain Ajax. Explains the differences in browser implementations and support as well as recommendations for usage.
    • Advanced Techniques—Dives into some of the more complex JavaScript patterns, including function currying, partial function application, and dynamic functions. Also covers creating a custom event framework to enable simple event support for custom objects.
    • Client-Side Storage—Discusses the various techniques for storing data on the client machine. Begins with a discussion of the most commonly supported feature, cookies, and then discusses newer functionality such as DOM storage.
    • Best Practices—Explores approaches to working with JavaScript in an enterprise environment. Techniques for better maintainability are discussed, including coding techniques, formatting, and general programming practices. Execution performance is discussed and several techniques for speed optimization are introduced. Last, deployment issues are discussed, including how to create a build process.
    • Upcoming APIs—Introduces APIs being created to augment JavaScript in the browser. Even though these APIs aren’t yet complete or fully implemented, they are on the horizon and browsers have already begun partially implementing their features. Includes the Selectors API and HTML 5.
    • The Evolution of JavaScript—Looks into the future of JavaScript to see where the language is headed. ECMAScript 3.1, ECMAScript 4, and ECMAScript Harmony are discussed.

    中文:

    书名:Professional JavaScript for Web Developers, 2nd Edition

    面向Web开发人员的专业Java脚本, 2nd Edition, provides a developer-level introduction along with the more advanced and useful features of JavaScript.

    这本书从一开始就探索了JavaScript是如何起源并演变成今天的样子的。下面将详细讨论组成JavaScript实现的组件,并特别关注ECMAScript和文档对象模型(DOM)等标准。还讨论了在不同流行的Web浏览器中使用的Java脚本实现的差异。

    在此基础上,本书继续介绍了JavaScript的基本概念,包括它的面向对象编程版本、继承以及它在各种标记语言(如HTML)中的使用。在深入研究事件和事件处理之后,我们探索了浏览器检测技术,并提供了在JavaScript中使用正则表达式的指南。然后,该书利用所有这些知识并将其应用于创建动态用户界面。

    The last part of the book is focused on advanced topics, including performance/memory optimization, best practices, and a look at where JavaScript is going in the future.

    本书面向三类读者:

    • 熟悉面向对象编程的有经验的开发人员,他们希望学习与传统面向对象语言(如Java和C++)相关的Java
    • Web应用程序开发人员试图增强其网站和Web应用程序的可用性
    • Novice JavaScript developers aiming to better understand the language

    此外,熟悉以下相关技术是本书适合您的有力标志:

    • Java
    • PHP
    • ASP.NET
    • HTML
    • CSS
    • XML

    本书不是针对缺乏基本计算机科学背景的初学者,也不是那些希望在网站上添加一些简单的用户交互的人。这些读者应该转而参考WROX的 从JavaScript开始,3rd Edition (Wiley, 2007).

    This book covers:

    • What Is JavaScript?—解释了JavaScript的起源:它从哪里来,它是如何演变的,以及它现在是什么样子。介绍的概念包括JavaScript和ECMAScript之间的关系、文档对象模型(DOM)和浏览器对象模型(BOM)。还包括对欧洲计算机制造商协会(ECMA)和万维网联盟(W3C)的相关标准的讨论。
    • JavaScript in HTML—研究了如何将JavaScript与HTML结合使用来创建动态网页。介绍将JavaScript嵌入到页面中的各种方法,包括围绕JavaScript内容类型及其与元素的关系的讨论。
    • 语言基础-介绍基本语言概念,包括语法和流控制语句。解释了JavaScript和其他基于C的语言在语法上的相似性,并指出了不同之处。引入了类型强制,因为它与内置运算符相关。
    • Variables, Scope, and Memory—探讨如何在给定变量的松散类型性质的情况下在JavaScript中处理变量。文中还讨论了原始值和引用值之间的差异,以及与变量相关的执行上下文信息。此外,在JavaScript中关于垃圾收集的讨论解释了当变量超出作用域时如何回收内存。
    • 引用类型-介绍有关JavaScript内置引用类型的所有详细信息,例如 Object and Array。在理论上讨论了ECMA-262中描述的每个引用类型,并讨论了它们与浏览器实现的关系。
    • Object-Oriented Programming—解释如何在JavaScript中使用面向对象的编程。由于JavaScript没有类的概念,因此本文探索了几种用于对象创建和继承的流行技术。还讨论了函数原型的概念以及它与总体面向对象方法的关系。
    • Anonymous Functions—探索了JavaScript最强大的方面之一:匿名函数。主题包括闭包、如何 this对象工作、模块模式和创建私有对象成员。
    • The Browser Object Model—引入浏览器对象模型(BOM),该模型负责允许与浏览器本身交互的对象。文中介绍了每个BOM对象,包括 window, document, 位置, 导航器, and screen.
    • 客户端解决方案解释检测客户端计算机及其功能的各种方法。不同的技术包括能力检测和用户代理字符串检测。每种方法都讨论了利弊和情景适当性。
    • The Document Object Model—介绍了文档对象模型(DOM)级别1中定义的可在Java中使用的文档对象模型(DOM)对象。简要介绍了XML及其与DOM的关系,然后深入探讨了整个DOM以及它如何允许开发人员操作页面。
    • DOM级别2和3解释DOM级别2和3如何使用其他属性、方法和对象来增强DOM。讨论了Internet Explorer与其他浏览器之间的兼容性问题。
    • 活动-解释了事件在JavaScript中的性质、起源、遗留支持以及DOM如何重新定义事件的工作方式。涵盖了各种设备,包括Wii和iPhone。
    • 编写脚本形式介绍了如何使用JavaScript增强表单交互并解决浏览器限制问题。讨论的重点是单个表单元素,如文本框和选择框,以及数据验证和操作。
    • 错误处理和调试-讨论浏览器如何处理JavaScript代码中的错误,并提供几种处理错误的方法。还讨论了针对每个浏览器的调试工具和技术,包括简化调试过程的建议。
    • Java++中的XML介绍用于读取和操作可扩展标记语言(XML)数据的JavaScript功能。解释不同Web浏览器在支持和对象方面的差异,并提供简化跨浏览器编码的建议。本文还介绍了如何使用可扩展样式表语言转换(XSLT)来转换客户端上的XML数据。
    • 用于XML的ECMAScript-讨论用于XML的ECMAScript(E4X)扩展到JavaScript,该扩展旨在简化对XML的使用。解释与使用DOM进行XML操作相比,E4X的优势。
    • Ajax and JSON—介绍了常见的AJAX技术,包括使用 XMLHttpRequest 对象和Internet Explorer XDomainRequest对象,用于跨域AJAX。解释浏览器实现和支持方面的差异以及使用建议。
    • Advanced Techniques—深入研究一些更复杂的JavaScript模式,包括函数汇聚、部分函数应用程序和动态函数。还包括创建自定义事件框架以启用对自定义对象的简单事件支持。
    • Client-Side Storage—讨论在客户端计算机上存储数据的各种技术。首先讨论最受支持的特性Cookie,然后讨论较新的功能,如DOM存储。
    • 最佳实践探索在企业环境中使用JavaScript的方法。讨论了提高可维护性的技术,包括编码技术、格式化和一般编程实践。讨论了执行性能,并介绍了几种优化速度的技术。最后,讨论了部署问题,包括如何创建构建流程。
    • Upcoming APIs—介绍正在创建的API,以增强浏览器中的Java脚本。尽管这些API还没有完成或完全实现,但它们即将出现,浏览器已经开始部分实现它们的功能。包括选择器API和HTML5。
    • The Evolution of JavaScript—展望了JavaScript的未来,看看这门语言的发展方向。讨论了ECMASSIPT 3.1、ECMASSIPT 4和ECMASSIPT和声。
  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

    平均分 0 / 5. 投票数: 0

    还没有投票!请为他投一票。

  • 评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册