Book description
As a web designer or developer, you know how powerful DOM scripting is for enhancing web pages and applications, adding dynamic functionality and improving the user experience. You've got a reasonable understanding of JavaScript and the DOM, but now you want to take your skills further. This book is all you need—it shows you how to add essential functionality to your web pages, such as on the fly layout and style changes, interface personalization, maps and search using APIs, visual effects using JavaScript libraries, and much more.
Includes a quick recap of the basics, for reference purposes
Packed with real world JavaScript solutions from beginning to end
Written by Beginning Google Maps author Jeffrey Sambells, and includes a case study by JavaScript guru Aaron Gustafson
Table of contents
- Copyright
- About the Authors
- About the Technical Reviewers
- About the Cover Image Designer
- Acknowledgments
- Introduction
-
1. DOM Scripting in Detail
-
1. Do It Right With Best Practices
- 1.1. Unobtrusive and progressive enhancement
-
1.2. Putting JavaScript to work
- 1.2.1. Separating your behavior from your structure
- 1.2.2. Don't version check!
- 1.2.3. Degrade gracefully for guaranteed accessibility
- 1.2.4. Plan for reuse with namespaces
-
1.2.5. Simplify things with reusable objects
- 1.2.5.1. Beginning the ADS library
- 1.2.5.2. The ADS.isCompatible() method
- 1.2.5.3. The ADS.$() method
- 1.2.5.4. The ADS.addEvent() and ADS.removeEvent() methods
- 1.2.5.5. The ADS.getElementsByClassName() method
- 1.2.5.6. The ADS.toggleDisplay() method
- 1.2.5.7. The ADS.insertAfter() method
- 1.2.5.8. The ADS.removeChildren() and ADS.prependChild() methods
- 1.2.6. Get your hands dirty
-
1.3. Common gotchas in the JavaScript syntax
- 1.3.1. Case sensitivity
- 1.3.2. Single vs. double quotes
- 1.3.3. Breaking lines
- 1.3.4. Optional semicolons and parentheses
- 1.3.5. Overloading (not really)
- 1.3.6. Anonymous functions
- 1.3.7. Scope resolution and closures
- 1.3.8. Iterating over objects
- 1.3.9. Referencing vs. calling a function (missing parentheses)
- 1.4. A practical example: WYSIWYG JavaScript rollover redux
- 1.5. Summary
- 2. Creating Your Own Reusable Objects
-
3. Understanding the DOM2 Core and DOM2 HTML
- 3.1. The DOM, not JavaScript, is your document
- 3.2. Levels of the DOM
- 3.3. Creating a sample document
- 3.4. The DOM Core
- 3.5. DOM HTML
- 3.6. A practical example: converting hand-coded HTML to DOM code
- 3.7. Summary
-
4. Responding to User Actions and Events
- 4.1. DOM2 Events
- 4.2. Types of events
- 4.3. Controlling event flow and registering event listeners
- 4.4. Summary
-
5. Dynamically Modifying Style and Cascading Style Sheets
- 5.1. The W3C DOM2 Style specification
- 5.2. When DOM scripting and style collide
- 5.3. Keeping style out of your DOM script
- 5.4. Accessing the computed style
- 5.5. The Microsoft filter property
- 5.6. Practical example: a simple transition effect
- 5.7. Summary
- 6. Case Study: A Photo Cropping and Resizing Tool
-
1. Do It Right With Best Practices
-
2. Communicating Outside the Browser
-
7. Adding Ajax to the Mix
- 7.1. Merging technology
- 7.2. Why Ajax may break your site and how to fix it
- 7.3. Practical example: an Ajax-enhanced photo album
- 7.4. Summary
- 8. Case Study: Enabling Asynchronous File Uploads with Progress Indicators
-
7. Adding Ajax to the Mix
-
3. Some Great Source
- 9. Using Libraries to Increase Productivity
-
10. Adding Effects to Enhance User Experience
- 10.1. Do it yourself
- 10.2. A few visual effects libraries
- 10.3. Some visual bling
- 10.4. Behavioral enhancements
- 10.5. Summary
- 11. Mashups Galore! Using APIs to Add Maps, Searching, and Much More
-
12. Case Study: Style Your select with the DOM
- 12.1. That classic feeling
- 12.2. Building a better select
- 12.3. Strategy? We don't need no stinkin' strategy . . .
- 12.4. Generating life and other memorable events
- 12.5. Bling-bling for da form t'ing
- 12.6. Behavioral modifications
- 12.7. Knock, knock . . . housekeeping!
- 12.8. Further adventures in select replacement
- 12.9. Summary
Product information
- Title: AdvancED DOM Scripting: Dynamic Web Design Techniques
- Author(s):
- Release date: August 2007
- Publisher(s): Apress
- ISBN: 9781590598566
You might also like
book
Beginning JavaScript with DOM Scripting and Ajax, Second Edition
Beginning JavaScript with DOM Scripting and Ajax is an essential resource for modern JavaScript programming. This …
book
Pro JavaScript Techniques, Second Edition
Pro JavaScript Techniques is the ultimate JavaScript book for today's web developer. It provides everything you …
book
Accelerated DOM Scripting with Ajax, APIs, and Libraries
If you're a web developer with previous JavaScript and DOM scripting experience, Accelerated DOM Scripting with …
book
Building Polyfills
Add custom features to browsers old and new by writing polyfill libraries, JavaScript plugins that take …