JavaScript: The Definitive Guide, Fourth Edition
Read it now on the O’Reilly learning platform with a 10-day free trial.
O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
Book description
JavaScript is a powerful, object-based scripting language; JavaScript programs can be embedded directly in HTML web pages. When combined with the Document Object Model (DOM) defined by a web browser, JavaScript allows you to create Dynamic HTML content and interactive client-side web applications. JavaScript syntax is based on the popular programming languages C, C++, and Java, which makes it familiar and easy to learn for experienced programmers. At the same time, JavaScript is an interpreted scripting language, providing a flexible, forgiving programming environment in which new programmers can learn. JavaScript: The Definitive Guide provides a thorough description of the core JavaScript language and both the legacy and standard DOMs implemented in web browsers. The book includes sophisticated examples that show you how to handle common tasks, like validating form data, working with cookies, and creating portable DHTML animations. The book also contains detailed reference sections that cover the core JavaScript API, the legacy client-side API, and the W3C standard DOM API, documenting every JavaScript object, method, property, constructor, constant, function, and event handler in those APIs. This fourth edition of the bestselling JavaScript book has been carefully updated to cover JavaScript 1.5 (ECMAScript version 3). The book also provides complete coverage of the W3C DOM standard (Level 1 and Level 2), while retaining material on the legacy Level 0 DOM for backward compatibility. JavaScript: The Definitive Guide is a complete programmer's guide and reference manual for JavaScript. It is particularly useful for developers working with the latest standards-compliant web browsers, like Internet Explorer 6, Netscape 6, and Mozilla. HTML authors can learn how to use JavaScript to build dynamic web pages. Experienced programmers can quickly find the information they need to start writing sophisticated JavaScript programs. This book is an indispensable reference for all JavaScript programmers, regardless of experience level.
Table of contents
-
JavaScript: The Definitive Guide, 4th Edition
- Preface
- 1. Introduction to JavaScript
-
I. Core JavaScript
- 2. Lexical Structure
- 3. Data Types and Values
- 4. Variables
- 5. Expressions and Operators
- 6. Statements
- 7. Functions
- 8. Objects
- 9. Arrays
- 10. Pattern Matching with Regular Expressions
- 11. Further Topics in JavaScript
-
II. Client-Side JavaScript
- 12. JavaScript in Web Browsers
- 13. Windows and Frames
- 14. The Document Object
- 15. Forms and Form Elements
- 16. Scripting Cookies
- 17. The Document Object Model
- 18. Cascading Style Sheets and Dynamic HTML
-
19. Events and Event Handling
- Basic Event Handling
- Advanced Event Handling with DOM Level 2
- The Internet Explorer Event Model
- The Netscape 4 Event Model
- 20. Compatibility Techniques
- 21. JavaScript Security
- 22. Using Java with JavaScript
-
III. Core JavaScript Reference
-
23. Core JavaScript Reference
- Sample Entry
- arguments[ ]
- Arguments
- Arguments.callee
- Arguments.length
- Array
- Array.concat( )
- Array.join( )
- Array.length
- Array.pop( )
- Array.push( )
- Array.reverse( )
- Array.shift( )
- Array.slice( )
- Array.sort( )
- Array.splice( )
- Array.toLocaleString( )
- Array.toString( )
- Array.unshift( )
- Boolean
- Boolean.toString( )
- Boolean.valueOf( )
- Date
- Date.getDate( )
- Date.getDay( )
- Date.getFullYear( )
- Date.getHours( )
- Date.getMilliseconds( )
- Date.getMinutes( )
- Date.getMonth( )
- Date.getSeconds( )
- Date.getTime( )
- Date.getTimezoneOffset( )
- Date.getUTCDate( )
- Date.getUTCDay( )
- Date.getUTCFullYear( )
- Date.getUTCHours( )
- Date.getUTCMilliseconds( )
- Date.getUTCMinutes( )
- Date.getUTCMonth( )
- Date.getUTCSeconds( )
- Date.getYear( )
- Date.parse( )
- Date.setDate( )
- Date.setFullYear( )
- Date.setHours( )
- Date.setMilliseconds( )
- Date.setMinutes( )
- Date.setMonth( )
- Date.setSeconds( )
- Date.setTime( )
- Date.setUTCDate( )
- Date.setUTCFullYear( )
- Date.setUTCHours( )
- Date.setUTCMilliseconds( )
- Date.setUTCMinutes( )
- Date.setUTCMonth( )
- Date.setUTCSeconds( )
- Date.setYear( )
- Date.toDateString( )
- Date.toGMTString( )
- Date.toLocaleDateString( )
- Date.toLocaleString( )
- Date.toLocaleTimeString( )
- Date.toString( )
- Date.toTimeString( )
- Date.toUTCString( )
- Date.UTC( )
- Date.valueOf( )
- decodeURI( )
- decodeURIComponent( )
- encodeURI( )
- encodeURIComponent( )
- Error
- Error.message
- Error.name
- Error.toString( )
- escape( )
- eval( )
- EvalError
- Function
- Function.apply( )
- Function.arguments[]
- Function.call( )
- Function.caller
- Function.length
- Function.prototype
- Function.toString( )
- Global
- Infinity
- isFinite( )
- isNaN( )
- Math
- Math.abs( )
- Math.acos( )
- Math.asin( )
- Math.atan( )
- Math.atan2( )
- Math.ceil( )
- Math.cos( )
- Math.E
- Math.exp( )
- Math.floor( )
- Math.LN10
- Math.LN2
- Math.log( )
- Math.LOG10E
- Math.LOG2E
- Math.max( )
- Math.min( )
- Math.PI
- Math.pow( )
- Math.random( )
- Math.round( )
- Math.sin( )
- Math.sqrt( )
- Math.SQRT1_2
- Math.SQRT2
- Math.tan( )
- NaN
- Number
- Number.MAX_VALUE
- Number.MIN_VALUE
- Number.NaN
- Number.NEGATIVE_INFINITY
- Number.POSITIVE_INFINITY
- Number.toExponential( )
- Number.toFixed( )
- Number.toLocaleString( )
- Number.toPrecision( )
- Number.toString( )
- Number.valueOf( )
- Object
- Object.constructor
- Object.hasOwnProperty( )
- Object.isPrototypeOf( )
- Object.propertyIsEnumerable( )
- Object.toLocaleString( )
- Object.toString( )
- Object.valueOf( )
- parseFloat( )
- parseInt( )
- RangeError
- ReferenceError
- RegExp
- RegExp.exec( )
- RegExp.global
- RegExp.ignoreCase
- RegExp.lastIndex
- RegExp.source
- RegExp.test( )
- RegExp.toString( )
- String
- String.charAt( )
- String.charCodeAt( )
- String.concat( )
- String.fromCharCode( )
- String.indexOf( )
- String.lastIndexOf( )
- String.length
- String.localeCompare( )
- String.match( )
- String.replace( )
- String.search( )
- String.slice( )
- String.split( )
- String.substr( )
- String.substring( )
- String.toLocaleLowerCase( )
- String.toLocaleUpperCase( )
- String.toLowerCase( )
- String.toString( )
- String.toUpperCase( )
- String.valueOf( )
- SyntaxError
- TypeError
- undefined
- unescape( )
- URIError
-
23. Core JavaScript Reference
-
IV. Client-Side JavaScript Reference
-
24. Client-Side JavaScript Reference
- Sample Entry
- Anchor
- Applet
- Area
- Button
- Button.onclick
- Checkbox
- Checkbox.onclick
- Document
- Document.all[]
- Document.captureEvents( )
- Document.clear( )
- Document.close( )
- Document.cookie
- Document.domain
- Document.elementFromPoint( )
- Document.getSelection( )
- Document.handleEvent( )
- Document.lastModified
- Document.links[]
- Document.open( )
- Document.releaseEvents( )
- Document.routeEvent( )
- Document.URL
- Document.write( )
- Document.writeln( )
- Element
- Event
- FileUpload
- FileUpload.onchange
- Form
- Form.elements[]
- Form.onreset
- Form.onsubmit
- Form.reset( )
- Form.submit( )
- Form.target
- Frame
- getClass( )
- Hidden
- History
- History.back( )
- History.forward( )
- History.go( )
- HTMLElement
- HTMLElement.contains( )
- HTMLElement.getAttribute( )
- HTMLElement.handleEvent( )
- HTMLElement.insertAdjacentHTML( )
- HTMLElement.insertAdjacentText( )
- HTMLElement.onclick
- HTMLElement.ondblclick
- HTMLElement.onhelp
- HTMLElement.onkeydown
- HTMLElement.onkeypress
- HTMLElement.onkeyup
- HTMLElement.onmousedown
- HTMLElement.onmousemove
- HTMLElement.onmouseout
- HTMLElement.onmouseover
- HTMLElement.onmouseup
- HTMLElement.removeAttribute( )
- HTMLElement.scrollIntoView( )
- HTMLElement.setAttribute( )
- Image
- Image.onabort
- Image.onerror
- Image.onload
- Input
- Input.blur( )
- Input.click( )
- Input.focus( )
- Input.name
- Input.onblur
- Input.onchange
- Input.onclick
- Input.onfocus
- Input.select( )
- Input.type
- Input.value
- JavaArray
- JavaClass
- JavaObject
- JavaPackage
- JSObject
- JSObject.call( )
- JSObject.eval( )
- JSObject.getMember( )
- JSObject.getSlot( )
- JSObject.getWindow( )
- JSObject.removeMember( )
- JSObject.setMember( )
- JSObject.setSlot( )
- JSObject.toString( )
- Layer
- Layer.captureEvents( )
- Layer.handleEvent( )
- Layer.load( )
- Layer.moveAbove( )
- Layer.moveBelow( )
- Layer.moveBy( )
- Layer.moveTo( )
- Layer.moveToAbsolute( )
- Layer.offset( )
- Layer.releaseEvents( )
- Layer.resizeBy( )
- Layer.resizeTo( )
- Layer.routeEvent( )
- Link
- Link.onclick
- Link.onmouseout
- Link.onmouseover
- Link.target
- Location
- Location.reload( )
- Location.replace( )
- MimeType
- Navigator
- Navigator.javaEnabled( )
- Navigator.plugins.refresh( )
- Option
- Password
- Plugin
- Radio
- Radio.onclick
- Reset
- Reset.onclick
- Screen
- Select
- Select.onchange
- Select.options[]
- Style
- Submit
- Submit.onclick
- Text
- Text.onchange
- Textarea
- Textarea.onchange
- URL
- Window
- Window.alert( )
- Window.back( )
- Window.blur( )
- Window.captureEvents( )
- Window.clearInterval( )
- Window.clearTimeout( )
- Window.close( )
- Window.confirm( )
- Window.defaultStatus
- Window.focus( )
- Window.forward( )
- Window.handleEvent( )
- Window.home( )
- Window.moveBy( )
- Window.moveTo( )
- Window.name
- Window.navigate( )
- Window.onblur
- Window.onerror
- Window.onfocus
- Window.onload
- Window.onmove
- Window.onresize
- Window.onunload
- Window.open( )
- Window.print( )
- Window.prompt( )
- Window.releaseEvents( )
- Window.resizeBy( )
- Window.resizeTo( )
- Window.routeEvent( )
- Window.scroll( )
- Window.scrollBy( )
- Window.scrollTo( )
- Window.setInterval( )
- Window.setTimeout( )
- Window.status
- Window.stop( )
-
24. Client-Side JavaScript Reference
-
V. W3C DOM Reference
-
25. W3C DOM Reference
- Sample Entry
- AbstractView
- AbstractView.getComputedStyle( )
- Attr
- CDATASection
- CharacterData
- CharacterData.appendData( )
- CharacterData.deleteData( )
- CharacterData.insertData( )
- CharacterData.replaceData( )
- CharacterData.substringData( )
- Comment
- Counter
- CSS2Properties
- CSSCharsetRule
- CSSFontFaceRule
- CSSImportRule
- CSSMediaRule
- CSSMediaRule.deleteRule( )
- CSSMediaRule.insertRule( )
- CSSPageRule
- CSSPrimitiveValue
- CSSPrimitiveValue.getCounterValue( )
- CSSPrimitiveValue.getFloatValue( )
- CSSPrimitiveValue.getRectValue( )
- CSSPrimitiveValue.getRGBColorValue( )
- CSSPrimitiveValue.getStringValue( )
- CSSPrimitiveValue.setFloatValue( )
- CSSPrimitiveValue.setStringValue( )
- CSSRule
- CSSRuleList
- CSSRuleList.item( )
- CSSStyleDeclaration
- CSSStyleDeclaration.getPropertyCSSValue( )
- CSSStyleDeclaration.getPropertyPriority( )
- CSSStyleDeclaration.getPropertyValue( )
- CSSStyleDeclaration.item( )
- CSSStyleDeclaration.removeProperty( )
- CSSStyleDeclaration.setProperty( )
- CSSStyleRule
- CSSStyleSheet
- CSSStyleSheet.deleteRule( )
- CSSStyleSheet.insertRule( )
- CSSUnknownRule
- CSSValue
- CSSValueList
- CSSValueList.item( )
- Document
- Document.createAttribute( )
- Document.createAttributeNS( )
- Document.createCDATASection( )
- Document.createComment( )
- Document.createDocumentFragment( )
- Document.createElement( )
- Document.createElementNS( )
- Document.createEntityReference( )
- Document.createEvent( )
- Document.createNodeIterator( )
- Document.createProcessingInstruction( )
- Document.createRange( )
- Document.createTextNode( )
- Document.createTreeWalker( )
- Document.getElementById( )
- Document.getElementsByTagName( )
- Document.getElementsByTagNameNS( )
- Document.getOverrideStyle( )
- Document.importNode( )
- DocumentCSS
- DocumentEvent
- DocumentFragment
- DocumentRange
- DocumentStyle
- DocumentTraversal
- DocumentType
- DocumentView
- DOMException
- DOMImplementation
- DOMImplementation.createCSSStyleSheet( )
- DOMImplementation.createDocument( )
- DOMImplementation.createDocumentType( )
- DOMImplementation.createHTMLDocument( )
- DOMImplementation.hasFeature( )
- DOMImplementationCSS
- Element
- Element.getAttribute( )
- Element.getAttributeNode( )
- Element.getAttributeNodeNS( )
- Element.getAttributeNS( )
- Element.getElementsByTagName( )
- Element.getElementsByTagNameNS( )
- Element.hasAttribute( )
- Element.hasAttributeNS( )
- Element.removeAttribute( )
- Element.removeAttributeNode( )
- Element.removeAttributeNS( )
- Element.setAttribute( )
- Element.setAttributeNode( )
- Element.setAttributeNodeNS( )
- Element.setAttributeNS( )
- ElementCSSInlineStyle
- Entity
- EntityReference
- Event
- Event.initEvent( )
- Event.preventDefault( )
- Event.stopPropagation( )
- EventException
- EventListener
- EventTarget
- EventTarget.addEventListener( )
- EventTarget.dispatchEvent( )
- EventTarget.removeEventListener( )
- HTMLAnchorElement
- HTMLAnchorElement.blur( )
- HTMLAnchorElement.focus( )
- HTMLBodyElement
- HTMLCollection
- HTMLCollection.item( )
- HTMLCollection.namedItem( )
- HTMLDocument
- HTMLDocument.close( )
- HTMLDocument.getElementById( )
- HTMLDocument.getElementsByName( )
- HTMLDocument.open( )
- HTMLDocument.write( )
- HTMLDocument.writeln( )
- HTMLDOMImplementation
- HTMLElement
- HTMLFormElement
- HTMLFormElement.reset( )
- HTMLFormElement.submit( )
- HTMLInputElement
- HTMLInputElement.blur( )
- HTMLInputElement.click( )
- HTMLInputElement.focus( )
- HTMLInputElement.select( )
- HTMLOptionElement
- HTMLSelectElement
- HTMLSelectElement.add( )
- HTMLSelectElement.blur( )
- HTMLSelectElement.focus( )
- HTMLSelectElement.remove( )
- HTMLTableCaptionElement
- HTMLTableCellElement
- HTMLTableColElement
- HTMLTableElement
- HTMLTableElement.createCaption( )
- HTMLTableElement.createTFoot( )
- HTMLTableElement.createTHead( )
- HTMLTableElement.deleteCaption( )
- HTMLTableElement.deleteRow( )
- HTMLTableElement.deleteTFoot( )
- HTMLTableElement.deleteTHead( )
- HTMLTableElement.insertRow( )
- HTMLTableRowElement
- HTMLTableRowElement.deleteCell( )
- HTMLTableRowElement.insertCell( )
- HTMLTableSectionElement
- HTMLTableSectionElement.deleteRow( )
- HTMLTableSectionElement.insertRow( )
- HTMLTextAreaElement
- HTMLTextAreaElement.blur( )
- HTMLTextAreaElement.focus( )
- HTMLTextAreaElement.select( )
- LinkStyle
- MediaList
- MediaList.appendMedium( )
- MediaList.deleteMedium( )
- MediaList.item( )
- MouseEvent
- MouseEvent.initMouseEvent( )
- MutationEvent
- MutationEvent.initMutationEvent( )
- NamedNodeMap
- NamedNodeMap.getNamedItem( )
- NamedNodeMap.getNamedItemNS( )
- NamedNodeMap.item( )
- NamedNodeMap.removeNamedItem( )
- NamedNodeMap.removeNamedItemNS( )
- NamedNodeMap.setNamedItem( )
- NamedNodeMap.setNamedItemNS( )
- Node
- Node.appendChild( )
- Node.cloneNode( )
- Node.hasAttributes( )
- Node.hasChildNodes( )
- Node.insertBefore( )
- Node.isSupported( )
- Node.normalize( )
- Node.removeChild( )
- Node.replaceChild( )
- NodeFilter
- NodeIterator
- NodeIterator.detach( )
- NodeIterator.nextNode( )
- NodeIterator.previousNode( )
- NodeList
- NodeList.item( )
- Notation
- ProcessingInstruction
- Range
- Range.cloneContents( )
- Range.cloneRange( )
- Range.collapse( )
- Range.compareBoundaryPoints( )
- Range.deleteContents( )
- Range.detach( )
- Range.extractContents( )
- Range.insertNode( )
- Range.selectNode( )
- Range.selectNodeContents( )
- Range.setEnd( )
- Range.setEndAfter( )
- Range.setEndBefore( )
- Range.setStart( )
- Range.setStartAfter( )
- Range.setStartBefore( )
- Range.surroundContents( )
- Range.toString( )
- RangeException
- Rect
- RGBColor
- StyleSheet
- StyleSheetList
- StyleSheetList.item( )
- Text
- Text.splitText( )
- TreeWalker
- TreeWalker.firstChild( )
- TreeWalker.lastChild( )
- TreeWalker.nextNode( )
- TreeWalker.nextSibling( )
- TreeWalker.parentNode( )
- TreeWalker.previousNode( )
- TreeWalker.previousSibling( )
- UIEvent
- UIEvent.initUIEvent( )
- ViewCSS
-
25. W3C DOM Reference
- VI. Class, Property, Method, and Event Handler Index
- Index
- Colophon
Product information
- Title: JavaScript: The Definitive Guide, Fourth Edition
- Author(s):
- Release date: November 2001
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596000486
You might also like
book
JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition
by John Pollock
Fully updated for the latest JavaScript standard and featuring a new chapter on HTML5 and jQuery …
book
JavaScript: Visual QuickStart Guide, Eighth Edition
by Tom Negrino, Dori Smith
This task-based, visual-reference guide has been fully revised and uses step-by-step instructions and plenty of screenshots …
book
Beginning JavaScript: The Ultimate Guide to Modern JavaScript Development
by Russ Ferguson
Discover everything you need to know to get up-to-speed with JavaScript development and add dynamic enhancements …
book
JavaScript: Novice to Ninja, 2nd Edition
by Darren Jones
JavaScript is a must-have skill for all web developers. JavaScript: Novice to Ninja is a fun, …