You are previewing DOM Scripting: Web Design with JavaScript and the Document Object Model.
O'Reilly logo
DOM Scripting: Web Design with JavaScript and the Document Object Model

Book Description

We know from the success of titles such as Web Standards Solutions, Cascading Style Sheets: Separating Content from Presentation, and The Web Designer's Reference that web designers are increasingly concerned with making sites that don't just look pretty, but are also built using current best practices.

There are three main technologies married together to create usable, standards-compliant web designs: XHTML for data structure, Cascading Style Sheets for styling your data, and JavaScript for adding dynamic effects and manipulating structure on the fly using the Document Object Model.

This book is about the latter of the three. DOM Scripting: Web Design with JavaScript and the Document Object Model gives you everything you need to start using JavaScript and the Document Object Model to enhance your web pages with client-side dynamic effects. Jeremy Keith starts off by giving you a basic crash course in JavaScript and the DOM, then moves on to provide you with several real-world examples built up from scratch, including dynamic image galleries and dynamic menus. Then, he shows you how to manipulate web page style using the CSS DOM, and create markup on the fly.

Table of Contents

  1. Title Page
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. Foreword by Dave Shea
  6. About the Author
  7. About the Technical Reviewer
  8. About the Foreword Writer
  9. Acknowledgments
  10. Introduction
  11. Chapter 1: A Brief History of Javascript
    1. The origins of JavaScript
    2. The browser wars
    3. Raising the standard
    4. What's next?
  12. Chapter 2: Javascript Syntax
    1. What you'll need
    2. Syntax
    3. Statements
    4. Variables
    5. Operations
    6. Conditional statements
    7. Looping statements
    8. Functions
    9. Objects
    10. What's next?
  13. Chapter 3: The Document Object Model
    1. D is for document
    2. Objects of desire
    3. Dial M for model
    4. Taking stock
    5. What's next?
  14. Chapter 4: A Javascript Image Gallery
    1. The markup
    2. The JavaScript
    3. Applying the JavaScript
    4. Expanding the function
    5. What's next?
  15. Chapter 5: Best Practices
    1. Please don't let me be misunderstood
    2. Graceful degradation
    3. The lessons of CSS
    4. Unobtrusive JavaScript
    5. Backwards compatibility
    6. What's next?
  16. Chapter 6: Image Gallery Revisited
    1. A quick recap
    2. Does it degrade gracefully?
    3. Is the JavaScript unobtrusive?
    4. Assuming too much
    5. DOM Core and HTML-DOM
    6. What's next?
  17. Chapter 7: Creating Markup on the Fly
    1. document.write
    2. innerHTML
    3. DOM methods
    4. Revisiting the image gallery
    5. Summary
    6. What's next?
  18. Chapter 8: Enhancing Content
    1. What not to do
    2. Making the invisible visible
    3. The content
    4. The markup
    5. The CSS
    6. The JavaScript
    7. Summary
    8. What's next?
  19. Chapter 9: CSS-DOM
    1. Three sheets to the Web
    2. The style property
    3. Knowing when to use DOM styling
    4. className
    5. What's next?
  20. Chapter 10: Animated Slideshow
    1. What is animation?
    2. Practical animation
    3. Refining the animation
    4. Final touches
    5. What's next?
  21. Chapter 11: Putting it All Together
    1. The brief
    2. Design
    3. CSS
    4. Color
    5. Markup
    6. JavaScript
    7. Summary
    8. What's next?
  22. Chapter 12: The Future of DOM Scripting
    1. The state of the Web
    2. Ajax
    3. Applications on the Web
    4. What's next?
  23. Reference
    1. Methods
    2. Properties
  24. Index