- 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 <canvas > tag to create on-the-fly graphics
- 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
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.
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 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
|Full Code Download||Download|
|37||Error in Text,On page 37, the section entitled NaN , the last two sentences of the first paragraph(begins with For example ) should be replaced with:|
For example, attempting to divide a number by a non-number typically causes an error in other languages, halting execution. In ECMAScript, dividing a number by a non-number returns NaN, which allows other processing to continue.
|40||Error in Code,The following code currently reads:|
//56 (octal) in ECMAScript 3, 0 (decimal) in ECMAScript 5 var num = parseInt(�070�);
It should read:
//56 (octal) in ECMAScript 3, 70 (decimal) in ECMAScript 5 var num = parseInt(�070�);
|40||Error in Description of Code,Currently reads: |
|82||Error in Text,The following sentence should be removed:|
This effect goes only one way: changing the named argument does not result in a change to the corresponding value in arguments.
This is no longer true.
|92||Error in Text,Currently reads: |
Neither the global context nor the local context of swapColors() has access to tempColor.
Neither the global context nor the local context of changeColor() has access to tempColor.
|108||Error in Text,Currently reads: ArrayFilterExample03.htm |
Should read: ArrayTypeExample03.htm.
|109||Error in Text,Currently reads: ArrayFilterExample04-06.htm |
Should read: ArrayTypeExample04-06.htm
|110||Error in Text,Currently reads: ArrayFilterExample07.htm |
Should read: ArrayTypeExample07.htm
|114||Error in Code,Currently reads: //get the first item |
Should read: //get the first last item
The same change should be made in ArrayTypeExample12.htm.
|122||Error in Text,This sentence: |
Using this data storage format, the Date type can accurately represent dates 285,616 years before or after January 1, 1970.
Using this data storage format, the Date type can accurately represent dates 100,000,000 days before or after January 1, 1970.
|133||Error in Code,In this code snippet:|
var matches = pattern2.exec(text); console.log(matches.index); //0 console.log(matches); //cat console.log(pattern2.lastIndex); //0
The last line should be changed to:
console.log(pattern2.lastIndex); // 3
|746||Error in Text,2nd paragraph currently reads: |
There is also an Object.isFrozen() method to detect frozen objects. Since frozen objects are both sealed and extensible...
.... Since frozen objects are both sealed and not extensible...
|840||Error in Code,The function definition for isHiddenSupport (th