You are previewing JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition.
O'Reilly logo
JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition

Book Description

This task-based, visual reference guide has been fully revised. It uses step-by-step instructions and plenty of screenshots to give beginning and intermediate Web designers what they need to know to learn JavaScript. Readers can start from the beginning to get a tour of the programming language, or look up specific tasks to learn just what they need to know. In this updated seventh edition, readers will find new information on Ajax design and modern coding techniques.

Table of Contents

  1. Copyright
    1. Dedication
  2. Special Thanks to
  3. Introduction
    1. We wrote this book for you
    2. How to use this book
    3. You say browser, we say Kumbaya
    4. Don’t type that code!
    5. Time to get started
  4. Getting Acquainted with JavaScript
    1. What JavaScript Is
    2. JavaScript Isn’t Java
    3. Where JavaScript Came From
    4. What JavaScript Can Do
    5. What JavaScript Can’t Do
    6. What Is Ajax?
    7. The Snap-Together Language
      1. Objects
      2. Properties
      3. Methods
      4. Putting the pieces together
      5. Introducing the Document Object Model
    8. Handling Events
    9. Values and Variables
      1. Operators
    10. Assignments and Comparisons
      1. Comparisons
    11. Writing JavaScript-Friendly HTML
      1. Structure, presentation, and behavior
      2. Divs and spans
      3. Classes and ids
    12. What Tools to Use?
  5. Start Me Up!
    1. Where to Put Your Scripts
    2. About Functions
    3. Using External Scripts
    4. Putting Comments in Scripts
    5. Alerting the User
    6. Confirming a User’s Choice
      1. More about conditionals
    7. Prompting the User
    8. Redirecting the User with a Link
    9. Using JavaScript to Enhance Links
    10. Using Multi-level Conditionals
    11. Handling Errors
  6. Your First Web App
    1. Around and Around with Loops
      1. More about loops
    2. Passing a Value to a Function
    3. Detecting Objects
    4. Working with Arrays
    5. Working with Functions That Return Values
    6. Updating Arrays
    7. Using Do/While Loops
    8. Calling Scripts Multiple Ways
    9. Combining JavaScript and CSS
    10. Checking State
    11. Working with String Arrays
  7. Working with Images
    1. Creating Rollovers
    2. Creating More Effective Rollovers
    3. Building Three-State Rollovers
    4. Triggering Rollovers from a Link
    5. Making Multiple Links Change a Single Rollover
    6. Working with Multiple Rollovers
    7. Creating Cycling Banners
    8. Adding Links to Cycling Banners
    9. Building Wraparound Slideshows
    10. Displaying a Random Image
    11. Cycling Images with a Random Start
  8. Frames, Frames, and More Frames
    1. Keeping a Page out of a Frame
    2. Forcing a Page into a Frame
    3. Forcing a Site into a Frame
    4. Setting a Target
    5. Creating and Loading a Dynamic Frame
    6. Sharing Functions between Frames
    7. Loading Multiple Frames at Once
    8. Working with Iframes
    9. Loading Iframes with JavaScript
  9. Working with Windows
    1. Opening a New Window
    2. Loading Different Contents into a Window
    3. Opening Multiple Windows
    4. Updating One Window from Another
    5. Closing a Window
    6. Putting Windows in Their Place
  10. Form Handling
    1. Select-and-Go Navigation
    2. Changing Menus Dynamically
    3. Making Fields Required
    4. Checking Fields against Each Other
    5. Identifying Problem Fields
    6. Putting Form Validation into Action
    7. Working with Radio Buttons
    8. Setting One Field with Another
    9. Validating Zip Codes
    10. Validating Email Addresses
  11. Forms and Regular Expressions
    1. Validating an Email Address with Regular Expressions
    2. Validating a File Name
    3. Extracting Strings
    4. Formatting Strings
    5. Formatting and Sorting Strings
    6. Formatting and Validating Strings
    7. Replacing Elements using Regular Expressions
  12. Handling Events
    1. Handling Window Events
      1. The onload event
      2. The onunload event
      3. The onresize event
      4. The onmove event
      5. The onabort event
      6. The onerror event
      7. The onfocus event
      8. The onblur event
    2. Mouse Event Handling
      1. The onmousedown event
      2. The onmouseup event
      3. The onmousemove event
      4. The onmouseover event
      5. The onmouseout event
      6. The ondblclick event
      7. The onclick event
    3. Form Event Handling
      1. The onsubmit event
      2. The onreset event
      3. The onchange event
      4. The onselect event
      5. The onclick event
      6. The onblur event
      7. The onfocus event
    4. Key Event Handling
      1. The onkeydown event
      2. The onkeyup event
      3. The onkeypress event
  13. JavaScript and Cookies
    1. Baking Your First Cookie
    2. Reading a Cookie
    3. Showing Your Cookies
    4. Using Cookies as Counters
    5. Deleting Cookies
    6. Handling Multiple Cookies
    7. Displaying “New to You” Messages
  14. Objects and the DOM
    1. About Node Manipulation
      1. DOM-2 and the W3C
      2. DOM-2 terminology
      3. DOM-3
    2. Adding Nodes
    3. Deleting Nodes
    4. Deleting Specific Nodes
    5. Inserting Nodes
    6. Replacing Nodes
    7. Writing Code with Object Literals
  15. Making Your Pages Dynamic
    1. Putting the Current Date into a Web Page
    2. Working with Days
    3. Customizing a Message for the Time of Day
    4. Displaying Dates by Time Zone
    5. Converting 24-Hour to 12-Hour Time
    6. Creating a Countdown
    7. Hiding and Displaying Layers
    8. Moving an Object in the Document
    9. Date Methods
  16. Introducing Ajax
    1. Ajax: Pinning It Down
    2. Reading Server Data
    3. Parsing Server Data
    4. Refreshing Server Data
    5. Getting Data From a Server
    6. Previewing Links with Ajax
    7. Auto-Completing Form Fields
  17. Ajax Toolkits
    1. Dragging and Dropping Page Elements
    2. Adding a Calendar to Your Page
    3. Adding a 2-up Calendar to Your Page
    4. Using the Container Utility
    5. Adding Animation Effects
    6. Implementing the Logger Control for Debugging
  18. Applied JavaScript
    1. Using Sliding Menus
    2. Adding Pull-Down Menus
    3. Enhancing Pull-down Menus
    4. A Slideshow with Captions
    5. A Silly Name Generator
    6. A Bar Graph Generator
    7. Style Sheet Switcher
  19. Designing with Ajax
    1. Highlighting New Elements
    2. Creating Accordion Menus
    3. Creating Smarter Dialogs
    4. Striping Tables
    5. Sorting Tables
  20. Bookmarklets
    1. Your First Bookmarklet
    2. Resetting a Web Page’s Background
    3. Changing a Page’s Styles
    4. Word Lookups
    5. Viewing Images
    6. Displaying ISO Latin Characters
    7. Converting RGB Values to Hex
    8. Converting Values
    9. A Bookmarklet Calculator
    10. Shortening URLs
    11. Validating Pages
    12. Mailing Pages
    13. Resizing Pages
  21. JavaScript Genealogy and Reference
    1. JavaScript Versions
      1. Netscape’s JavaScript
      2. Microsoft’s JScript
      3. AOL
    2. ECMAScript
    3. Object Flowchart
    4. The Big Object Table
  22. JavaScript Reserved Words
    1. JavaScript reserved words
    2. Additional words reserved for future use by ECMAScript 3
    3. ECMAScript 4 Reserved Words
    4. ES4 Contextually Reserved Words
    5. Other identifiers to avoid
  23. Cascading Style Sheets Reference
  24. Where to Learn More
    1. Finding Help Online
      1. Mozilla sites
      2. Other useful sites
        1. Microsoft’s JScript Language
        2. Yahoo! User Interface Library
        3. Yahoo! JavaScript Developer Center
        4. Yahoo! Design Pattern Library
      3. Weblogs
        1. Ajaxian
        2. QuirksMode
        3. Continuing Intermittent Incoherency
        4. Microsoft’s JScript Blog
        5. Yahoo! User Interface Blog
        6. Surfin’ Safari
      4. Elsewhere
    2. Books
      1. JavaScript, The Definitive Guide
      2. ppk on JavaScript
      3. Bulletproof Ajax
      4. Pro JavaScript Techniques