Book description
Learn everything about utilizing the JavaScript language with the next generation of Rich Internet Applications from the accessible information in JavaScript Programmer's Reference, both a tutorial and a reference guide for web developers. Master methods for using Java with applications like Microsoft's Silverlight, Ajax, Flex, Flash and AIR by practicing with hands-on examples with practical, usable code. Employ this complete JavaScript reference to help you understand JavaScript Data Types, Variables, Operators, Expressions and Statements, work with JavaScript Frameworks and data, and improve performance with Ajax.
Table of contents
- Copyright
- About the Author
- Credits
- Acknowledgments
- Introduction
- 1. Introduction to JavaScript
- 2. JavaScript in the Browser
-
3. JavaScript Basics
-
3.1. General Characteristics
- 3.1.1. A Dynamic Language
- 3.1.2. A Prototype-Based Language
- 3.1.3. Character Encoding
- 3.1.4. Case Sensitivity
- 3.1.5. Whitespace and Semicolons
- 3.1.6. Literals
- 3.1.7. Statements
- 3.1.8. Blocks
- 3.1.9. Closures
- 3.1.10. Comments
- 3.1.11. Reserved Words
- 3.2. Variables
- 3.3. Data Types
- 3.4. Summary
-
3.1. General Characteristics
-
4. Expressions, Operators, and Statements
- 4.1. JavaScript Expressions
- 4.2. JavaScript Operators
- 4.3. JavaScript Statements
- 4.4. Summary
- 5. Functions
-
6. The Global and Object Objects
- 6.1. Features of the Global Object
- 6.2. The Global Object in the Browser
- 6.3. Getting the Global Object
- 6.4. Global Properties
- 6.5. Global Functions
- 6.6. Global Objects
- 6.7. The Object Object
- 6.8. Summary
-
7. The String and RegExp Objects
- 7.1. String Object Overview
- 7.2. String Basics
-
7.3. Working with Strings
- 7.3.1. The Formatting Methods
- 7.3.2. Working with Case
-
7.3.3. Searching and Replacing
- 7.3.3.1. The indexOf and lastIndexOf Methods
-
7.3.3.2. Regular Expressions
- 7.3.3.2.1. Defining
- 7.3.3.2.2. Special Characters
- 7.3.3.2.3. Repetition
- 7.3.3.2.4. Position
- 7.3.3.2.5. Groupings
- 7.3.3.2.6. Alternatives
- 7.3.3.2.7. Pattern Reuse
- 7.3.3.2.8. The RegExp Object
- 7.3.3.2.9. The Basics
- 7.3.3.2.10. An Improved contains Method
- 7.3.3.2.11. Executing Searches with the RegExp Object
- 7.3.3.2.12. Using the Static Properties
- 7.3.3.3. The search Method
- 7.3.3.4. The match Method
- 7.3.3.5. The replace Method
- 7.3.3.6. Examples
- 7.3.4. Slicing and Dicing
- 7.3.5. Strings and Arrays
- 7.3.6. Encoding Strings for URL's
- 7.4. Summary
- 8. The Boolean, Number, and Math Objects
- 9. The Array and Date Objects
-
10. Object Oriented Development
- 10.1. Object Oriented JavaScript
- 10.2. Creating Objects
- 10.3. Deleting Properties and Objects
- 10.4. Objects as Reference Types
- 10.5. Objects as Arrays
- 10.6. Comparing Objects
- 10.7. Object Cloning
- 10.8. Static Members
- 10.9. Constructors
- 10.10. Prototypes
- 10.11. The this Keyword
- 10.12. Private Members
- 10.13. Inheritance in JavaScript
- 10.14. Summary
-
11. Windows and Frames
- 11.1. Overview of the Browser Object Model
- 11.2. The window Object
- 11.3. Working with Frames
- 11.4. Manipulating Windows
- 11.5. Dialogues and Alerts
- 11.6. Obtaining Browser and OS Information
- 11.7. Window Events
- 11.8. Summary
- 12. Events
-
13. The Document Object Model
- 13.1. The History of the DOM
- 13.2. Document Types
- 13.3. The Document Tree
- 13.4. Node Types
- 13.5. Node Properties
- 13.6. Node Methods
- 13.7. The implementation Object
- 13.8. Traversing the DOM
- 13.9. Element Attributes
- 13.10. Finding Specific Elements
- 13.11. Creating and Deleting Nodes
- 13.12. DOM Ranges
- 13.13. Summary
- 14. Forms
-
15. Cascading Style Sheets
- 15.1. Overview
- 15.2. styleSheet and Style Objects
- 15.3. Imported Style Sheets
- 15.4. Iterating Over All Stylesheets
- 15.5. Adding and Removing Style Sheets
- 15.6. Iterating over All Rules
- 15.7. Reading and Writing Style Properties
- 15.8. Adding and Removing Rules
- 15.9. Computed Styles
- 15.10. IE's filter Object
- 15.11. Summary
- 16. Dynamic HTML
- 17. JavaScript Security
- 18. Client-Side Data and Persistence
- 19. Ajax
- 20. Working with XML
- 21. Working with JSON
- 22. Unique Browser Features
- 23. Scripting Plugins
- 24. Debugging
- 25. Performance Tuning
-
A. Core JavaScript Language
-
A.1. JavaScript Operators
- A.1.1. Arithmetic
-
A.1.2. Assignment
- A.1.2.1. %= (Modulus Assignment)
- A.1.2.2. &= (Bitwise AND Assignment)
- A.1.2.3. *= (Multiplication Assignment)
- A.1.2.4. += (Addition Assignment)
- A.1.2.5. −= (Subtraction Assignment)
- A.1.2.6. /= (Division Assignment)
- A.1.2.7. <<= (Shift Left Assignment)
- A.1.2.8. = (Assignment)
- A.1.2.9. >>= (Shift Right with Sign Assignment)
- A.1.2.10. >>>= (Shift Right Zero Fill Assignment)
- A.1.2.11. ^= (Bitwise Exclusive OR Assignment)
- A.1.2.12. |= (Bitwise OR Assignment)
- A.1.3. Bitwise
- A.1.4. Comparison
- A.1.5. Logical
- A.1.6. String
- A.1.7. Other
-
A.2. JavaScript Statements
- A.2.1. block { }
- A.2.2. break
- A.2.3. const
- A.2.4. continue
- A.2.5. do..while
- A.2.6. export
- A.2.7. for
- A.2.8. for each..in
- A.2.9. for..in
- A.2.10. function
- A.2.11. if..else
- A.2.12. import
- A.2.13. label
- A.2.14. return
- A.2.15. switch
- A.2.16. throw
- A.2.17. try..catch
- A.2.18. var
- A.2.19. while
- A.2.20. with
- A.3. JavaScript Comments
-
A.1. JavaScript Operators
-
B. JavaScript Global Objects
- B.1. ActiveXObject
-
B.2. Array
- B.2.1. Syntax
- B.2.2. Description
- B.2.3. Example
- B.2.4. Array.index
- B.2.5. Array.input
- B.2.6. Array.length
- B.2.7. Array.prototype
- B.2.8. Array.every(callback [, thisObject])
- B.2.9. Array.filter(callback [, thisObject])
- B.2.10. Array.forEach(callback [, thisObject])
- B.2.11. Array.indexOf()
- B.2.12. Array.join(separator)
- B.2.13. Array.lastIndexOf(searchElement [, fromIndex])
- B.2.14. Array.map(callback [, thisObject])
- B.2.15. Array.pop()
- B.2.16. Array.push()
- B.2.17. Array.reduce(callback [, initialValue])
- B.2.18. Array.reduceRight(callback [, initialValue])
- B.2.19. Array.reverse()
- B.2.20. Array.shift()
- B.2.21. Array.slice(beginIndex [,endIndex])
- B.2.22. Array.some(callback [, thisObject])
- B.2.23. Array.sort()
- B.2.24. Array.splice(index, deleteCount, [element0,..., elementN])
- B.2.25. Array.toLocaleString()
- B.2.26. Array.toSource()
- B.2.27. Array.toString()
- B.2.28. Array.unshift()
- B.2.29. Array.valueOf()
- B.2.30. Boolean
- B.2.31. Syntax
- B.2.32. Description
- B.2.33. Example
- B.2.34. Boolean.toJSON()
- B.2.35. Boolean.toSource()
- B.2.36. Boolean.toString()
- B.2.37. Boolean.valueOf()
-
B.3. Date
- B.3.1. Syntax
- B.3.2. Description
- B.3.3. Example
- B.3.4. Date.getDate()
- B.3.5. Date.getDay()
- B.3.6. Date.getFullYear()
- B.3.7. Date.getHours()
- B.3.8. Date.getMilliseconds()
- B.3.9. Date.getMinutes()
- B.3.10. Date.getMonth()
- B.3.11. Date.getSeconds()
- B.3.12. Date.getTime()
- B.3.13. Date.getTimezoneOffset()
- B.3.14. Date.getUTCDate()
- B.3.15. Date.getUTCDay()
- B.3.16. Date.getUTCFullYear()
- B.3.17. Date.getUTCHours()
- B.3.18. Date.getUTCMilliseconds()
- B.3.19. Date.getUTCMinutes()
- B.3.20. Date.getUTCMonth()
- B.3.21. Date.getUTCSeconds()
- B.3.22. Date.getYear()
- B.3.23. Date.now()
- B.3.24. Date.parse(datestring)
- B.3.25. Date.setDate(day)
- B.3.26. Date.setFullYear(year)
- B.3.27. Date.setHours()
- B.3.28. Date.setMilliseconds(millisecondsVal)
- B.3.29. Date.setMinutes(minutesVal)
- B.3.30. Date.setMonth(monthValue)
- B.3.31. Date.setSeconds(secondsVal)
- B.3.32. Date.setTime(msValue)
- B.3.33. Date.setUTCDate(dayOfMonth)
- B.3.34. Date.setUTCFullYear(yearVal)
- B.3.35. Date.setUTCHours(hoursVal)
- B.3.36. Date.setUTCMilliseconds(msValue)
- B.3.37. Date.setUTCMinutes(minVal)
- B.3.38. Date.setUTCMonth(monthVal)
- B.3.39. Date.setUTCSeconds(secVal)
- B.3.40. Date.setYear(yearVal)
- B.3.41. Date.toDateString()
- B.3.42. Date.toGMTString()
- B.3.43. Date.toJSON()
- B.3.44. Date.toLocaleDateString()
- B.3.45. Date.toLocaleFormat(stringFormat)
- B.3.46. Date.toLocaleString()
- B.3.47. Date.toLocaleTimeString()
- B.3.48. Date.toSource()
- B.3.49. Date.toString()
- B.3.50. Date.toTimeString()
- B.3.51. Date.toUTCString()
- B.3.52. Date.UTC()
- B.3.53. Date.valueOf()
- B.4. Debug
- B.5. Enumerator
- B.6. Error
-
B.7. Function
- B.7.1. Syntax
- B.7.2. Description
- B.7.3. Example
- B.7.4. Function.arguments
- B.7.5. Function.arity
- B.7.6. Function.callee
- B.7.7. Function.caller
- B.7.8. Function.length
- B.7.9. Function.name
- B.7.10. Function.apply()
- B.7.11. Function.call()
- B.7.12. Function.toSource()
- B.7.13. Function.toString()
- B.7.14. Function.valueOf()
- B.8. JSON
-
B.9. Math
- B.9.1. Syntax
- B.9.2. Description
- B.9.3. Example
- B.9.4. Math.E
- B.9.5. Math.LN10
- B.9.6. Math.LN2
- B.9.7. Math.LOG10E
- B.9.8. Math.LOG2E
- B.9.9. Math.PI
- B.9.10. Math.SQRT1_2
- B.9.11. Math.SQRT2
- B.9.12. Math.abs(numVal)
- B.9.13. Math.acos(numVal)
- B.9.14. Math.asin(numVal)
- B.9.15. Math.atan(numVal)
- B.9.16. Math.atan2(numVal)
- B.9.17. Math.ceil(numVal)
- B.9.18. Math.cos()
- B.9.19. Math.exp(numVal)
- B.9.20. Math.floor()
- B.9.21. Math.log(numVal)
- B.9.22. Math.max(numVal1[, numVal2[, .., numValN]])
- B.9.23. Math.min(numVal1[, numVal2[, .., numValN]])
- B.9.24. Math.pow(baseVal, expVal)
- B.9.25. Math.random()
- B.9.26. Math.round(numVal)
- B.9.27. Math.sin(numVal)
- B.9.28. Math.sqrt(numVal)
- B.9.29. Math.tan(numVal)
- B.9.30. Math.toSource()
- B.9.31. Math.toString()
-
B.10. Number
- B.10.1. Syntax
- B.10.2. Description
- B.10.3. Example
- B.10.4. Number.MAX_VALUE
- B.10.5. Number.MIN_VALUE
- B.10.6. Number.NaN
- B.10.7. Number.NEGATIVE_INFINITY
- B.10.8. Number.POSITIVE_INFINITY
- B.10.9. Number.prototype
- B.10.10. Number.toExponential([fractionDigits])
- B.10.11. Number.toFixed([fractionDigits])
- B.10.12. Number.toJSON()
- B.10.13. Number.toLocaleString()
- B.10.14. Number.toPrecision([precision])
- B.10.15. Number.toString([radixbase])
- B.10.16. Number.valueOf()
-
B.11. Object
- B.11.1. Syntax
- B.11.2. Description
- B.11.3. Example
- B.11.4. Object.constructor
- B.11.5. Object.prototype
- B.11.6. Object.__parent__
- B.11.7. Object.__proto__
- B.11.8. Object.eval(codetoeval)
- B.11.9. Object.hasOwnProperty(prop)
- B.11.10. Object.isPrototypeOf()
- B.11.11. Object.propertyIsEnumerable(prop)
- B.11.12. Object.toLocaleString()
- B.11.13. Object.toSource()
- B.11.14. Object.toString()
- B.11.15. Object.unwatch(property)
- B.11.16. Object.valueOf()
- B.11.17. Object.watch()
- B.11.18. Object.__defineGetter__(prop, funct)
- B.11.19. Object.__defineSetter__(prop, funct)
- B.11.20. Object.__lookupGetter__(sprop)
- B.11.21. Object.__lookupSetter__(sprop)
- B.11.22. Object.__noSuchMethod__()
-
B.12. RegExp
- B.12.1. Syntax
- B.12.2. Description
- B.12.3. Example
- B.12.4. RegExp.$1..$9
- B.12.5. RegExp.global
- B.12.6. RegExp.ignoreCase
- B.12.7. RegExp.index
- B.12.8. RegExp.input
- B.12.9. RegExp.lastIndex
- B.12.10. RegExp.lastMatch
- B.12.11. RegExp.lastParen
- B.12.12. RegExp.leftContext
- B.12.13. RegExp.multiline
- B.12.14. RegExp.rightContext
- B.12.15. RegExp.source
- B.12.16. RegExp.exec(string)
- B.12.17. RegExp.test(string)
- B.12.18. RegExp.toSource()
- B.12.19. RegExp.toString()
-
B.13. String
- B.13.1. Syntax
- B.13.2. Description
- B.13.3. Example
- B.13.4. String.length
- B.13.5. String.prototype
- B.13.6. String.anchor(anchorString)
- B.13.7. String.big()
- B.13.8. String.blink()
- B.13.9. String.bold()
- B.13.10. String.charAt(pos)
- B.13.11. String.charCodeAt(num)
- B.13.12. String.concat([string2[, string3[, ...]]])
- B.13.13. String.fixed()
- B.13.14. String.fontcolor(colorVal)
- B.13.15. String.fontsize(fSize)
- B.13.16. String.fromCharCode([code1[, code2[, ...]]])
- B.13.17. String.indexOf(string[, num])
- B.13.18. String.italics()
- B.13.19. String.lastIndexOf(substring[, startindex])
- B.13.20. String.link(linkUrl)
- B.13.21. String.localeCompare(strComp)
- B.13.22. String.match(regEx)
- B.13.23. String.quote()
- B.13.24. String.replace(regEx, replaceString)
- B.13.25. String.search(regEx)
- B.13.26. String.slice(start, [end])
- B.13.27. String.small()
- B.13.28. String.split([separatorStr [, limit]])
- B.13.29. String.strike()
- B.13.30. String.sub()
- B.13.31. String.substr(pos [, length])
- B.13.32. String.substring(start [, end])
- B.13.33. String.sup()
- B.13.34. String.toJSON()
- B.13.35. String.toLocaleLowerCase()
- B.13.36. String.toLocaleUpperCase()
- B.13.37. String.toLowerCase()
- B.13.38. String.toSource()
- B.13.39. String.toString()
- B.13.40. String.toUpperCase()
- B.13.41. String.valueOf()
- B.14. VBArray
-
B.15. XMLHttpRequest
- B.15.1. Syntax
- B.15.2. Description
- B.15.3. Example
- B.15.4. XMLHttpRequest.onreadystatechange
- B.15.5. XMLHttpRequest.readyState
- B.15.6. XMLHttpRequest.responseBody
- B.15.7. XMLHttpRequest.responseText
- B.15.8. XMLHttpRequest.responseXML
- B.15.9. XMLHttpRequest.status
- B.15.10. XMLHttpRequest.statusText
- B.15.11. XMLHttpRequest.abort()
- B.15.12. XMLHttpRequest.getAllResponseHeaders()
- B.15.13. XMLHttpRequest.getResponseHeader(headerLabel)
- B.15.14. XMLHttpRequest.open(method, url [, asyncFlag [, userName [, password]]])
- B.15.15. XMLHttpRequest.send(content)
- B.15.16. XMLHttpRequest.setRequestHeader(label, value)
- C. JavaScript Global Properties
- D. JavaScript Global Functions
- E. Reserved and Special Words
-
F. Document Object Reference
- F.1. Area Object Reference
- F.2. Canvas Object Reference
- F.3. cssRule and rule Object Reference
- F.4. document Object Reference
- F.5. Event Object Reference
- F.6. external Object Reference
- F.7. Generic Element Reference
- F.8. History Object Reference
-
F.9. HTML Form Reference
- F.9.1. Properties
- F.9.2. Methods
- F.9.3. Events
- F.9.4. FIELDSET and LEGEND Objects
- F.9.5. LABEL Object
- F.9.6. General INPUT Objects
- F.9.7. BUTTON, SUBMIT and RESET Objects
- F.9.8. CHECKBOX and RADIO Objects
- F.9.9. IMAGE Object
- F.9.10. TEXT, PASSWORD and HIDDEN Objects
- F.9.11. TEXTAREA Object
- F.9.12. SELECT Object
- F.9.13. FILE Object
- F.10. HTML Table Reference
- F.11. Image Object Reference
- F.12. Link and Anchor Object Reference
- F.13. Location Object Reference
- F.14. Range Object Reference
- F.15. Selection Object Reference
- F.16. Storage Object Reference
- F.17. Style Object Reference
- F.18. styleSheet Object Reference
- F.19. TextRange Reference
- F.20. Window Object Reference
- G. Resources on the Web
Product information
- Title: JavaScript® Programmer's Reference
- Author(s):
- Release date: August 2009
- Publisher(s): Wrox
- ISBN: 9780470344729
You might also like
book
Pro JavaScript™ Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything …
book
Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP
This invaluable resource offers tutorials and real-world examples as well as thorough language references for Web …
book
HTML5 Unleashed
HTML5 Unleashed is the authoritative guide that covers the key web components driving the future of …
book
ADO.NET Cookbook
Designed in the highly regarded O'Reilly Cookbook format, ADO.NET Cookbook is strikingly different from other books …