Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the author
OK
Professional JavaScript for Web Developers 2nd Edition
There is a newer edition of this item:
$57.91
(7)
Only 2 left in stock - order soon.
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 this object 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 3 Explains 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 XDomainRequest object 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.
- ISBN-10047022780X
- ISBN-13978-0470227800
- Edition2nd
- PublisherWrox
- Publication dateJanuary 14, 2009
- LanguageEnglish
- Dimensions7.6 x 1.7 x 9.3 inches
- Print length840 pages
Products related to this item
Editorial Reviews
From the Back Cover
You'll explore basic concepts of JavaScript including its version of object-oriented programming, inheritance, and its use in HTML and XHTML. A detailed discussion of the components that make up a JavaScript implementation follows, with specific focus on standards such as ECMAScript and DOM. All three levels of DOM are explained, including advanced topics such as event simulation, XML parsing, and XPath queries. You'll also learn how to utilize regular expressions and build dynamic user interfaces. This valuable insight will help you apply JavaScript solutions to the business problems faced by Web developers everywhere.
What you will learn from this book
All of the details regarding JavaScript's built-in reference types
How to use object-oriented programming in JavaScript
Ways to detect the client machine and its capabilities
Debugging tools and techniques for each browser
Steps for reading and manipulating XML data
How to create a custom event framework
Various techniques for storing data on the client machine
Approaches to working with JavaScript in an enterprise environment
Who this book is for
This book is for Web developers who want to use JavaScript to dramatically improve the usability of their Web sites and Web applications and for those with programming experience, especially object-oriented programming experience.
Wrox Professional guides are planned and written by working programmers to meet the real-world needs of programmers, developers, and IT professionals. Focused and relevant, they address the issues technology professionals face every day. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job.
About the Author
Product details
- Publisher : Wrox; 2nd edition (January 14, 2009)
- Language : English
- Paperback : 840 pages
- ISBN-10 : 047022780X
- ISBN-13 : 978-0470227800
- Item Weight : 2.7 pounds
- Dimensions : 7.6 x 1.7 x 9.3 inches
- Customer Reviews:
About the author

Nicholas C. Zakas is a front-end consultant who specializes in user interface design and implementation for web applications using JavaScript, Dynamic HTML, CSS, XML, and XSLT. Has has 15 years of web development experience and spent nearly five years at Yahoo! in various roles, including principal front end engineer for the Yahoo! homepage and contributor to the Yahoo! User Interface (YUI) library, having written the Cookie Utility, Profiler, and YUI Test.
Nicholas is the author of Professional JavaScript for Web Developers and High Performance JavaScript, a co-author on Professional Ajax, and a contributor to Even Faster Web Sites. He has also written for several online sites such as WebReference, Sitepoint, the YUI Blog, A List Apart, and the Web Performance Advent Calendar.
Nicholas regularly gives talks about web development, JavaScript, and best practices. He has given talks at companies such as Yahoo!, LinkedIn, Google, Netflix, TripAdvisor, and NASA, and conferences such as the Ajax Experience, the Rich Web Experience, OSCON, WebDirections, Fronteers, and Velocity.
Through his writing and speaking, Nicholas seeks to teach others the valuable lessons he’s learned while working on some of the most popular and demanding web applications in the world. He firmly believes that no difficult problem should need to be solved more than once.
Products related to this item
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
So that being said, if you consider yourself or would like to consider yourself a professional front-end engineer for web applications (or in any way want to become a JavaScript expert), I cannot recommend this book enough. On the one hand, you have Crockford's JavaScript: The Good Parts--which does a great job of eviscerating JavaScript while at the same time extracting its (well...) its Good Parts--but it's like someone ran the text through a minification utility and made it tokenized and super-dense and stripped out all the comments. And on the other hand, you have Zakas' Professional JavaScript for Web Developers which one might describe as <em>The Good Parts (the long version)</em>.
What Zakas gives us--while assuming that you are already doing some professional JavaScript web development--is a good overview of JavaScript/ECMAScript, with special care given to make the text practical. This is not strictly an academic exercise; he is careful to make sure that each example applies to real world scenarios (<em>i.e.</em>, web apps running in a browser) and that you are able to take away something useful and meaningful from the text's discussion. In other words, he provides a road map for how to make the most of JavaScript as a language (...since, as a front-end engineer on the web, you're stuck with it.) and how to make it work in all the convoluted, counter-intuitive situations that you are basically guaranteed to encounter (Even if you don't expect to ever work with XML. Even if you do think that the JavaScript 2 and ECMAScript 4 stuff is a little too future-forward/in-the-weeds type stuff.).
In a nutshell, if you are doing professional web development on the front end, this book needs to be on your desk. I can't wait to check out his next book...
Of course, it is in the Professional series, but then one could expect content better organized fully according to programming theory, such as clearly by conditionals, looping, scoping, etc. These concepts are individuated, but they are used as subthemes rather than major themes in the text.
In all, the editors are to be faulted more than the author. A restructuring and rededication to the intended professional audience would make the book a pleasure.
As an example, the author is allowed to 'dramatically' introduce the concept of JavaScript classless objects in fits and starts until a sudden cascade of object initialization patterns floods the first chapter explicitly on objects. A much cleverer approach would be to introduce the hash-table nature of classless objects and to review dynamic scoping, then build on these without dramatic "you might be thinking A, but look, no, it's really B..." moments that only impede the professional's need for fast information that converges from both theoretical and detail ends into a practical middle ground.
That said, the cascade of initialization patterns is itself impressive, but even it should start with the accepted best practices among active JavaScript programmers then follow up with the less used and more theory-only patterns to show how and why the best-practice came to be, and provide insightfulness for deviating from the standards when conditions require more innovative solutions.
In all, the book is better than OK for the polyglot pro, but one can hope there are better books for, say, the monolingual VB programmer expanding his/her JavaScript to use with ASP. For the student, it would be a disaster, but that is definitely not its target audience, anyway.
This book is awesome. I had read previously read "Simply JavaScript" by Kevin Yank of [...]. That book is fine if you want to slap something into a website, clog up the browser's memory, and never write re-usable code. After that book (and many online tutorials) I was beginning to think there was something wrong with me because C++ was easier than JavaScript. Mr. Zakas goes in depth with JavaScript. I am so glad he wrote this book. I was riping my hair out of my head trying to understand this strange language. He covers everything from data types, functions, inline functions, references, arrays (which act like vectors and stacks, etc...), dom 1, 2, 3, event listeners, ajax, json, xml, animations, and the new future standards.
If you know C++ and JAVA it will be easier to understand the language. But generally speaking, if you know how to program you will do just fine. Just remember OOP in JavaScript is different. He explains the different methods since JavaScript isn't a OOP based languaged it's a prototype based language.
I read the 1 star reviews from the 1st edition. Don't be fooled by those reviews, the new version is king. If you really want to code JavaScript and master it, this book will be your bible.
Top reviews from other countries
In this book it is strangely missing.
Is there a table which tells me the members of the document type? If there is, I can't find it. Can't remember the capitalization of getelementbyid? It's not even in the index.
So although the text is generally well-written and expanded my knowledge of Javascript, I still need to refer to other sources or cheat sheets for basic API information.
It's written in quite an academic style without being dry, patronising, or smug. The underlying message of the book is that JavaScript is a 'proper' programming language with as well-established a set of patterns and tools as any other. Several chapters are given over to explaining core concepts such as variable scope, function declarations, and (very importantly) object-oriented programming in JavaScript. It is worth purchasing just for the best practice approach that it advocates (with clear examples). I particularly like the way that the author details the steps leading up a particular best practice (done brilliantly in the chapters on objects and inheritance). It is important to stress that this is not some abstract waffle, it is real-world stuff that you can use in professional web development projects.
Coverage of the BOM, DOM, and related eventing, is thorough, including the quirks of different browsers. Admittedly a lot of this is subsumed by toolsets such as jQuery, but it is very useful to understand what JavaScript can actually do in the browser. Also, although scant coverage is given to the full power of Ajax, this doesn't undermine the value of the book (and there is a chapter on the XMLHttpRequest which gives more than enough information to get started). There are also excellent chapters on maintainability, performancec, best practices, and third-party frameworks.
I really can't recommend this book enough. Given the amount of hacked and inline code I regularly see, this needs to be read by more developers.