Synopses & Reviews
JavaScript is loosely based on Java, which is an object-oriented programming language that became popular for use on the Web by way of embedded applets. It has a similar syntax and programming methodology to Java, however, it should not be considered the “light” version of the language. JavaScript is its own language that found its home in web browsers around the world and enabled enhanced user interaction on websites as well as web applications. In this book JavaScript is covered from its beginning in the earliest Netscape browsers to the present-day versions that can support the DOM and Ajax. You will learn how to extend the language to suit specific needs and how to create client-server communications without intermediaries such as Java or hidden frames. You will also learn how to apply JavaScript solutions to business problems faced by web developers everywhere.
This book provides a developer-level introduction along with more advanced and useful features of JavaScript. The book begins by exploring how JavaScript originated and evolved into what it is today. There is a discussion of the components that make up a JavaScript implementation that follows that has a 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. After building a strong base, the book goes on to cover basic concepts of JavaScript including its version of object-oriented programming, inheritance, and its use in HTML. The book then explores new APIs, such as HTML5, the Selectors API, and the File API. 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.
The book is broken up into 25 chapters. Chapter 1 explains the origins of JavaScript including where it came from, how it evolved, and what it is today. Chapter 2 examines how JavaScript is used in conjunction with HTML to create dynamic webpages. Chapter 3 introduces basic language concepts including syntax and flow control statements. Chapter 4 explores how variables are handled in JavaScript given their loosely typed nature. Chapter 5 covers all of the details regarding JavaScript’s built-in reference types such as object and array. Chapter 6 explains how to use object-oriented programing in JavaScript. Chapter 7 explores one of the most powerful aspects of JavaScript: function expressions. Chapter 8 introduces the Browser Object Model (BOM), which is responsible for objects allowing interaction with the browser itself. Chapter 9 explains various approaches to detecting the client machine and its capabilities. Chapter 10 introduces the Document Object Model (DOM) objects available in JavaScript as defined in DOM Level 1. Chapter 11 explains how other APIs, as well as other browsers, extend the DOM with more functionality. Chapter 12 builds on the previous two chapters by explaining how DOM Levels 2 and 3 augmented the DOM with additional properties, methods, and objects.
Chapter 13 explains the nature of events in JavaScript, where they originated, legacy support, and how the DOM redefined how events should work. Devices such as the Wii and iPhone are covered. Chapter 14 looks at using JavaScript to enhance form interactions and work around browser limitations. Chapter 15 discusses the
Synopsis
A significant update to a bestselling JavaScript bookAs the key scripting language for the web, JavaScript is supported by every modern web browser and allows developers to create client-side scripts that take advantage of features such as animating the canvas tag and enabling client-side storage and application caches. After an in-depth introduction to the JavaScript language, this updated edition of a bestseller progresses to break down how JavaScript is applied for web development using the latest web development technologies. Veteran author and JavaScript guru Nicholas Zakas shows how JavaScript works with the new HTML5 as well as other significant advances in web development as it relates to JavaScript.
- Begins with an introduction to JavaScript basics and then moves on to more advanced topics regarding JavaScript and advances in web development technologies
- Describes how JavaScript is implemented into HTML5
- Covers browser/feature detection in scripts, event-driven JavaScript development, error reporting and debugging, offline application and data storage, and more
Professional JavaScript for Web Developers, 3rd Edition is an authoritative JavaScript resource that every web developers should have.
Synopsis
Get up to date on the latest ways to use JavaScript in web developmentIf you want to achieve JavaScript's full potential, it is critical to understand its nature, history, and limitations. To that end, this updated version of the bestseller by veteran author and JavaScript guru Nicholas C. Zakas covers JavaScript from its very beginning to the present-day incarnations including the DOM, Ajax, and HTML5. Zakas shows you how to extend this powerful language to meet specific needs and create dynamic user interfaces for the web that blur the line between desktop and internet. By the end of the book, you'll have a strong understanding of the significant advances in web development as they relate to JavaScript so that you can apply them to your next website.
Professional JavaScript for Web Developers:
Offers a detailed discussion of the components that make up a JavaScript implementation
Zeroes in on new and emerging APIs such as the Selectors API, Web Workers, and Cross-Document Messaging
Explores object-oriented programming in JavaScript
Shows how to implement drag and drop file upload with Ajax and the File API
Highlights the new core language features introduced in ECMAScript5
Explains how to work with data formats such as XML and JSON
Looks at what's coming in ECMAScript Harmony
Walks you through creating offline-capable web applications
wrox.com
Programmer Forums
Join our Programmer to Programmer forums to ask and answer programming questions about this book, join discussions on the hottest topics in the industry, and connect with fellow programmers from around the world.
Code Downloads
Take advantage of free code samples from this book, as well as code samples from hundreds of other books, all ready to use.
Read More
Find articles, ebooks, sample chapters, and tables of contents for hundreds of books, and more reference resources on programming topics that matter to you.
Wrox Professional guides are written by working developers to address everyday needs. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job.
Synopsis
This book provides a developer-level introduction along with more advanced and useful features of JavaScript. Coverage includes:
- JavaScript use with HTML to create dynamic webpages, language concepts including syntax and flow control statements
- variable handling given their loosely typed nature
- built-in reference types such as object and array
- object-oriented programing
- powerful aspects of function expressions
- Browser Object Model allowing interaction with the browser itself
- detecting the client and its capabilities
- Document Object Model (DOM) objects available in DOM Level 1
- how DOM Levels 2 and 3 augmented the DOM
- events, legacy support, and how the DOM redefined how events should work
- enhancing form interactions and working around browser limitations
- using the
- JavaScript API changes in HTML5
- how browsers handle JavaScript errors and error handling
- features of JavaScript used to read and manipulate XML data
- the JSON data format as an alternative to XML
- Ajax techniques including the use of XMLHttpRequest object and CORS
- complex patterns including function currying, partial function application, and dynamic functions
- offline detection and storing data on the client machine
- techniques for JavaScript in an enterprise environment for better maintainability
This book is aimed at three groups of readers: Experienced object-oriented programming developers looking to learn JavaScript as it relates to traditional OO languages such as Java and C++; Web application developers attempting to enhance site usability; novice JavaScript developers.
Nicholas C. Zakas worked with the Web for over a decade. He has worked on corporate intranet applications used by some of the largest companies in the world and large-scale consumer websites such as MyYahoo! and the Yahoo! homepage. He regularly gives talks at companies and conferences regarding front-end best practices and new technology.
About the Author
Nicholas C. Zakas is a front-end architect who honed his skills working at Yahoo! for five years. He has worked in web development for over a decade, developing web solutions for some of the largest companies in the world. He is the author of previous editions of Professional JavaScript for Web Developers and a coauthor of Professional Ajax.
Table of Contents
FOREWORD xxxi
INTRODUCTION xxxiii
CHAPTER 1: WHAT IS JAVASCRIPT? 1
CHAPTER 2: JAVASCRIPT IN HTML 13
CHAPTER 3: LANGUAGE BASICS 25
CHAPTER 4: VARIABLES, SCOPE, AND MEMORY 85
CHAPTER 5: REFERENCE TYPES 103
CHAPTER 6: OBJECT-ORIENTED PROGRAMMING 173
CHAPTER 7: FUNCTION EXPRESSIONS 217
CHAPTER 8: THE BROWSER OBJECT MODEL 239
CHAPTER 9: CLIENT DETECTION 271
CHAPTER 10: THE DOCUMENT OBJECT MODEL 309
CHAPTER 11: DOM EXTENSIONS 357
CHAPTER 12: DOM LEVELS 2 AND 3 381
CHAPTER 13: EVENTS 431
CHAPTER 14: SCRIPTING FORMS 511
CHAPTER 15: GRAPHICS WITH CANVAS 551
CHAPTER 16: HTML5 SCRIPTING 591
CHAPTER 17: ERROR HANDLING AND DEBUGGING 607
CHAPTER 18: XML IN JAVASCRIPT 641
CHAPTER 19: ECMASCRIPT FOR XML 671
CHAPTER 20: JSON 691
CHAPTER 21: AJAX AND COMET 701
CHAPTER 22: ADVANCED TECHNIQUES 731
CHAPTER 23: OFFLINE APPLICATIONS AND CLIENT-SIDE STORAGE 765
CHAPTER 24: BEST PRACTICES 801
CHAPTER 25: EMERGING APIS 835
APPENDIX A: ECMASCRIPT HARMONY 857
APPENDIX B: STRICT MODE 877
APPENDIX C: JAVASCRIPT LIBRARIES 885
APPENDIX D: JAVASCRIPT TOOLS 891
INDEX 897