Table of Contents

Introduction

Chapter 1 Getting Acquainted with JavaScript

What JavaScript Is

JavaScript Isn’t Java

Where JavaScript Came From

What JavaScript Can Do

What JavaScript Can’t Do

What Is Ajax?

The Snap-Together Language

Handling Events

Values and Variables

Writing JavaScript-Friendly HTML

What Tools to Use?

Chapter 2 Start Me Up!

Where to Put Your Scripts

About Functions

Using External Scripts

Putting Comments in Scripts

Alerting the User

Confirming a User’s Choice

Prompting the User

Redirecting the User with a Link

Using JavaScript to Enhance Links

Using Multi-Level Conditionals

Handling Errors

Chapter 3 Your First Web App

Around and Around with Loops

Passing a Value to a Function

Detecting Objects

Working with Arrays

Working with Functions That Return Values

Updating Arrays

Using Do/While Loops

Calling Scripts Multiple Ways

Combining JavaScript and CSS

Checking State

Working with String Arrays

Chapter 4 Working with Images

Creating Rollovers

Creating More Effective Rollovers

Building Three-State Rollovers

Triggering Rollovers from a Link

Making Multiple Links Change a Single Rollover

Working with Multiple Rollovers

Creating Cycling Banners

Adding Links to Cycling Banners

Building Wraparound Slideshows

Displaying a Random Image

Cycling Images with a Random Start

Chapter 5 Windows and Frames

Keeping a Page out of a Frame

Setting a Target

Loading Iframes with JavaScript

Working with Iframes

Creating Dynamic Iframes

Sharing Functions between Documents

Opening a New Window

Loading Different Contents into a Window

Chapter 6 Form Handling

Select-and-Go Navigation

Changing Menus Dynamically

Making Fields Required

Checking Fields against Each Other

Identifying Problem Fields

Putting Form Validation into Action

Working with Radio Buttons

Setting One Field with Another

Validating Zip Codes

Validating Email Addresses

Chapter 7 Forms and Regular Expressions

Validating an Email Address with Regular Expressions

Validating a File Name

Extracting Strings

Formatting Strings

Formatting and Sorting Strings

Formatting and Validating Strings

Replacing Elements using Regular Expressions

Chapter 8 Handling Events

Handling Window Events

Mouse Event Handling

Form Event Handling

Key Event Handling

Chapter 9 JavaScript and Cookies

Baking Your First Cookie

Reading a Cookie

Showing Your Cookies

Using Cookies as Counters

Deleting Cookies

Handling Multiple Cookies

Displaying “New to You” Messages

Chapter 10 Objects and the DOM

About Node Manipulation

Adding Nodes

Deleting Nodes

Deleting Specific Nodes

Inserting Nodes

Replacing Nodes

Writing Code with Object Literals

Chapter 11 Making Your Pages Dynamic

Putting the Current Date into a Web Page

Working with Days

Customizing a Message for the Time of Day

Displaying Dates by Time Zone

Converting 24-Hour Time to 12-Hour Time

Creating a Countdown

Hiding and Displaying Layers

Moving an Object in the Document

Date Methods

Chapter 12 Applied JavaScript

Using Sliding Menus

Adding Pull-Down Menus

Enhancing Pull-Down Menus

A Slideshow with Captions

A Silly Name Generator

A Bar Graph Generator

Style Sheet Switcher

Chapter 13 Introducing Ajax

Ajax: Pinning It Down

Reading Server Data

Parsing Server Data

Refreshing Server Data

Getting Data From a Server

Previewing Links with Ajax

Auto-Completing Form Fields

Chapter 14 Toolkits, Frameworks, and Libraries

Adding jQuery

Updating a Page with jQuery

Interacting with jQuery

Interacting and Updating

Auto-Completing Fields

Chapter 15 Designing with jQuery

Highlighting New Elements

Creating Accordion Menus

Creating Smarter Dialogs

Striping Tables

Sorting Tables

Chapter 16 Building on jQuery

Using jQuery as a Foundation

Using ThemeRoller to Customize Your Look

Adding a Calendar to Your Page

Dragging and Dropping Elements

Using jQuery with External Data

Using jQuery Plugins

Chapter 17 Bookmarklets

Your First Bookmarklet

Resetting a Web Page’s Background

Changing a Page’s Styles

Word Lookups

Viewing Images

Displaying ISO Latin Characters

Converting RGB Values to Hex

Converting Values

A Bookmarklet Calculator

Shortening URLs

Validating Pages

Mailing Pages

Resizing Pages

Appendix A JavaScript Genealogy and Reference

JavaScript Versions

ECMAScript

Object Flowchart

The Big Object Table

Appendix B JavaScript Reserved Words

Appendix C Cascading Style Sheets Reference

Appendix D Where to Learn More

Finding Help Online

Offline Resources

Troubleshooting Tips

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.232.189