Pro Javascript Techniques

Язык: Английский
Год публикации: 2006
Автор(ы): John Resig
Страниц: 359
Краткое содержание
- Introducing Modern JavaScript
- Professional JavaScript Development
- Unobtrusive JavaScript
- Ajax
- The Future of JavaScript
- Appendixes
Полное содержание
- Introducing Modern JavaScript
- Modern JavaScript Programming
- Object-Oriented JavaScript
- Testing Your Code
- Packaging for Distribution
- Unobtrusive DOM Scripting
- The Document Object Model
- Events
- JavaScript and CSS
- Ajax
- Browser Support
- Summary
- Professional JavaScript Development
- Object-Oriented JavaScript
- Language Features
- References
- Funciton Overloading and Type-Checking
- Scope
- Closures
- Context
- Object-Oriented Basics
- Summary
- Creating Reusable Code
- Standardizing Object-Oriented Code
- Prototypal Inheritance
- Classical Inheritance
- The Base Library
- The Prototype Library
- Packaging
- Namespacing
- Cleaning Up Your Code
- Compression
- Distribution
- Summary
- Tools for Debugging and Testing
- Debugging
- Error console
- DOM Inspectors
- Firebug
- Venkman
- Testing
- Summary
- Unobtrusive JavaScript
- The Document Object Model
- An Introduction to the Document Object Model
- Navigating the DOM
- Handling White Space in the DOM
- Simple DOM Navigation
- Binding to Every HTML Element
- Standard DOM Methods
- Waiting for the HTML DOM to Load
- Waiting for the Page to Load
- Waiting for Most of the DOM to Load
- Figuring Out When the DOM Is Loaded
- Finding Elements in an HTML Document
- Finding Elements by Class Name
- Finding Elements by CSS Selector
- XPath
- Getting the Contents of an Element
- Getting the Text Inside an Element
- Getting the HTML Inside an Element
- Working with Element Attributes
- Getting and Setting an Attribute Value
- Modifying the DOM
- Creating Nodes Using the DOM
- Inserting into the DOM
- Injecting HTML into the DOM
- Removing Nodes from the DOM
- summary
- Events
- Introduction to JavaScript Events
- Asynchronous Events vs.Threads
- Event Phases
- Common Event Features
- The Event Object
- The this Keyword
- Canceling Event Bubbling
- Overriding the Browser's Default Action
- Binding Event Listeners
- Traditional Binding
- DOM Binding: W3C
- DOM Binding: IE
- addEvent and removeEvent
- Unobtrusive [DOM Scripting
- Anticipating JavaScript Being Disabled
- Making Sure Links Don't Rely on JavaScript
- Watching for When CSS Is Disabled
- Event Accessibility
- Summary
- JavaScript and CSS
- Accessing Style Information
- Dynamic Elements
- An Element's Position
- An Element's Size
- An Element's Visibility
- Animations
- The Browser
- Mouse Position
- The Viewport
- Drag-and-Drop
- Libraries
- moo.fx and jQuery
- Scriptaculous
- Improving Forms
- Form Validation
- Required Fields
- Pattern Matching
- Rule Set
- Displaying Error Messages
- Validation
- When to Validate
- Usability Improvements
- Hower Labels
- Marking Required Fields
- Summary
- Building an Image Gallery
- Example Galleries
- Building the Gallery
- Loading Unobtrusively
- Transparent Overlay
- Positioned Box
- Navigation
- Slideshow
- Summary
- Ajax
- Introduction to Ajax
- Using Ajax
- HTTP Requests
- HTTP Response
- Handling Response Data
- The Complete Ajax Package
- Examples of Different Data Usage
- An XML-Based RSS Feed
- An HTML Injector
- JSON and JavaScript: Remote Execution
- Summary
- Enhancing Blogs with Ajax
- Never-Ending Blog
- The Blog Template
- The Data Source
- Event Detection
- The Request
- The Result
- Live Blogging
- Summary
- Autocomplete Search
- Examples of Autocomplete Search
- Building the Page
- Watching for Key Input
- Retrieving the Results
- Navigating the Result List
- Keyboard Navigation
- Mouse Navigation
- The Final Result
- Summary
- An Ajax Wiki
- What is a Wiki?
- Talking With the Database
- The Ajax Request
- The Server-Side Code
- Handling a Request
- Executing and Formatting SQL
- Handling the JSON Response
- An Extra Case Study: A JavaScript Blog
- Application Code
- Core JavaScript Code
- JavaScript SQL Library
- Ruby Server-Side (Code
- Summary
- The Future of JavaScript
- Where Is JavaScript Going?
- JavaScript 1.6 and 1.7
- JavaScript 1.6
- JavaScript 1.7
- Web Applications 1.0
- Building a Clock
- Simple Planet Simulation
- Appendixes
- APPENDIX A DOM Reference
- Resources
- Terminology
- Global Variables
- DOM Navigation
- body
- childNodes
- documentElement
- firstChild
- getElementById( elemID )
- getElementsByTagName( tagName )
- lastChild
- nextSibling
- parentNode
- previousSibling
- Node Information
- innerText
- nodeName
- nodeType
- nodeValue
- Attributes
- className
- getAttribute( attrName)
- removeAttribute( attrName )
- setAttribute( attrName, attrValue )
- DOM Modification
- appendChild( nodeToAppend )
- cloneNode( truelfalse )
- createElement( tagName )
- createElementNS( namespace, tagName )
- createTextNode( textString )
- innerHTML
- insertBefore( nodeToInsert, nodeToInsertBefore )
- removeChild( nodeToRemove )
- replaceChild( nodeToInsert, nodeToReplace )
- APPENDIX B Events Reference
- Resources
- Terminology
- Event Object
- General Properties
- Mouse Properties
- Keyboard Properties
- Page Events
- load
- beforeunload
- error
- resize
- scroll
- unload
- UI Events
- Mouse Events
- click
- dblclick
- mousedown
- mouseup
- mousemove
- mouseover
- mouseout
- Keyboard Events
- Form Events
- APPENDIX C The Browsers
- Modern Browsers
- Internet Explorer
- Mozilla
- Safari
- Opera
|