Object-Oriented JavaScript
Formats:
save 40%!
save 37%!
Anytime, Anywhere
Free Shipping!
| Also available on: |
|
- Learn to think in JavaScript, the language of the web browser
- Object-oriented programming made accessible and understandable to web developers
- Do it yourself: experiment with examples that can be used in your own scripts
- Write better, more maintainable JavaScript code
Book Details
Language : EnglishPaperback : 356 pages [ 235mm x 191mm ]
Release Date : July 2008
ISBN : 1847194141
ISBN 13 : 9781847194145
Author(s) : Stoyan Stefanov
Topics and Technologies : All Books, AJAX, Open Source, Web Development
Table of Contents
Preface
Chapter 1: Introduction
Chapter 2: Primitive Data Types, Arrays, Loops, and Conditions
Chapter 3: Functions
Chapter 4: Objects
Chapter 5: Prototype
Chapter 6: Inheritance
Chapter 7: The Browser Environment
Chapter 8: Coding and Design Patterns
Appendix A: Reserved Words
Appendix B: Built-in Functions
Appendix C: Built-in Objects
Appendix D: Regular Expressions
Index
Stoyan Stefanov
Submit Errata
Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.
Errata
- 16 submitted: last submission 29 Apr 2013Errata type: Typo | page 25 | Errata date: 23 Oct 09
First line :: Modulo, the reminder of a division
Should be :: Modulo, the remainder of a division
Errata type: Technical | page 40 | Errata date: 30 Sep 09
First paragraph the sentence : "In the next example, if the variable v is defined, its value ..."
Should be : "In the next example, if the variable mynumber is defined, its value...
Errata type: Typo | page 71 | Errata date: 02 Apr 09
Last Sentence Before "Best Practice Tips"
It starts with "FThen",
It must start with "Then"
Errata type: Technical | page 74 | Errata date: 27 Oct 09
The sentence "Now we can pass those functions to the original function add() and get the result:"
Should be : "Now we can pass those functions to the original function invoke_and_add() and get the result:"
Errata type: Typo | page 75 | Errata date: 27 Oct 09
The sentence "Loops can be expensive if they go through a lot or repetitions."
should be : "Loops can be expensive if they go through a lot of repetitions."
Errata type: Typo | page 81 | Errata date: 02 Nov 09
The sentence : "Also notice how f1() includes a call to f2(), and it works- even though although f2() is not yet defined."
Should be : "Also notice how f1() includes a call to f2(), and it works- even thoughf2() is not yet defined."
Errata type: Technical | page 103 | Errata date: 04 Jun 09
>>>h instance of Object;
false
should be: >>>h instance of Object;
true
Errata type: Technical | page 115 | Errata date: 24 Aug 09
A.caller will be null.
In firebug, it appears to return function ()
Errata type: Typo | page 171 | Errata date: 24 Jul 09
First sentence : "The same happens when you call the isPropertyOf() method of the constructors passing my:"
Should be : "The same happens when you call the isPrototypeOf() method of the constructors passing my:"
Errata type: Typo | page 249 | Errata date: 04 Jun 09
In the third paragraph: The opposite of addEventLister() is removeEventListener() and it accepts exactly the same parameters. Let's remove the listener attached to the paragraph.
should be: The opposite of addEventListener() is removeEventListener() and it accepts exactly the same parameters. Let's remove the listener attached to the paragraph.
Errata type: Typo | page 303 | Errata date: 02 Apr 09
In place of : une, deux, trois
It should be: un, deux, trois
Errata type: Technical | page 113 | Errata date: 18 December 2009
Second sentence = "The first parameter to slice() is the start index and the second is the end index (both indices are zero-based)."
Should be = "The first parameter to slice() is the start index and the second is the end index not to be included in the returned slice (both indices are zero-based)."
Errata type: Technical | page 245 | Errata date: 02 March 2010
The code:
>>> var mypara = document.getElementById('my-div');
Should be:
>>> var mypara = document.getElementById('closer');
Errata type: Typo | page 135 | Errata date: 23 Oct 09
None of these properties, except for lastIndex, can be changed once the object has created.
Should be :: None of these properties, except for lastIndex, can be changed once the object has been created.
Errata type: Typo | page 134 | Errata date: 23 Oct 09
Last paragraph, second sentence reads: It means, "Match any string that starts with j, ends with t and has zero or more characters in between".
It should read: It means, "Match any string that starts with j, ends with t and has one or more characters in between."
Errata type: Typo | page 226 | Errata date: 28 Oct 11
2nd to last code snippet on the page ">>> bg.childNodes[1].textContent"
"bg" should be changed to "bd" = ">>> bd.childNodes[1].textContent"
Sample chapters
You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.
- Learn to think in JavaScript, the language of the web browser
- The basics of object-oriented programming, and how they apply to JavaScript
- Set up and use your training environment (Firebug)
- Master data types, operators, and flow control statements
- Understand functions: usage patterns, variable scope, and built-in functions
- Closures demystified
- Create and use objects
- Understand and use prototypes
- Reuse code with common patterns for inheritance
- Understand and work with the BOM (Browser Object Model)
- The DOM (Document Object Model) – accessing, modifying, adding, and deleting nodes
- Build responsive web pages with AJAX
- JSON (JavaScript Object Notation)
- Listen and respond to browser events
- Apply design patterns to solve common problems
- Adopt coding patterns that unleash the unique power of the language
- Make your programs cleaner, faster, and compatible with other programs and libraries
- Achieve missing object-oriented features in JavaScript such as private properties and methods
Once listed in the "nice to have" sections of job postings, these days the knowledge of JavaScript is a deciding factor when it comes to hiring web developers. And rightly so. Where in the past we used to have the occasional few lines of JavaScript embedded in a web page, now we have advanced libraries and extensible architectures, powering the "fat-client", AJAX-type rich internet applications.
JavaScript is the language of the browser, but it's also heavily employed in many other environments: server-side programming, desktop applications, application extensions and widgets. It's a pretty good deal: you learn one language and then code all kinds of different applications. While this book has one chapter specifically dedicated to the web browser environment including DOM, events, and AJAX tutorials, the rest is applicable to all the other environments too.
This book treats JavaScript as a serious object-oriented language, showing you how to build robust, maintainable, and powerful libraries and applications. Along the way, we cover many of the recent innovations such as AJAX, JSON, and interesting design and coding patterns. After reading this book, you'll be prepared to ace your JavaScript job interview and even impress with some bits that the interviewer maybe didn't know. You should read this book if you want to be able to take your JavaScript skills to a new level of sophistication.
Create scalable and reusable high-quality JavaScript applications and libraries using the concepts of object-oriented programming
The book requires no prior knowledge of JavaScript and works from the ground up to give you a thorough grounding in this powerful language. If you do already know some JavaScript, you will find plenty of eye-openers as you discover just what the language can do.
This book takes a do-it-yourself approach when it comes to writing code, because the best way to really learn a programming language is by writing code. You are encouraged to type code into Firebug's console, see how it works and then tweak it and play around with it. There are practice questions at the end of each chapter to help review what you have learned.

