JavaScript & Ajax Visual QuickStart Guide

JavaScript is a programming language that you can use to add interactivity to your Web pages. JavaScript lets you create an active user interface, giving the users feedback as they navigate your pages. You can use JavaScript to make sure that your users enter valid information in forms, which can save your business time and money. With JavaScript you have the ability create customized Web pages, depending on actions that the user takes.

JavaScript controls the browser, so you can open up new windows, display alert boxes, and put custom messages in the status bar of the browser window. You can also use JavaScript to deal with forms, set cookies, build HTML pages on the fly, and create Web-based applications.

Ch1: Getting Acquainted with JavaScript

JavaScript is a programming language that you can use to add interactivity to your Web pages.

Ch2: Start Me Up!

You'll learn where to put your scripts in your HTML, how you can leave comments in your scripts so you can more easily understand them at a later time, and how you can use scripts to communicate with the user. You'll also see how to make the page automatically change to another page (called redirection).

Ch3: Your First Web App

In this chapter we'll go into more detail about the basic elements of JavaScript and introduce you to other aspects of the JavaScript language: loops, arrays, and more about functions. You'll see how you can use JavaScript to write your Web pages for you, learn how JavaScript handles errors that the user makes, and more.

Ch4: Working with Images

Rollovers are a great tool, but you can do much more than rollovers with JavaScript, such as automatically change images, create ad banners, build slideshows, and display random images on a page.

Ch5: Frames, Frames, and More Frames

We'll demonstrate how to harness the power of JavaScript to make frames even more useful. A frame consists of at least three pages of HTML: the first is frameset aka the top or parent, the remainder of the pages fit into the panes that the frameset has created and are the child pages.

Ch6: Working with Windows

In this chapter, you'll learn how to use JavaScript to open and close, update, and position windows. You'll see how you can use JavaScript to write information into windows, so you can build a Web page on the fly.

Ch7: Form Handling

In this chapter, you'll learn how to use JavaScript make sure that your forms contain valid information, check data in one field against the data in another field, and highlight incorrect information to let the user know what needs to be changed.

Ch8: Forms and Regular Expressions

There are many regular expression operators, and we'll look at the most common in this chapter. By learning and using these operators, you'll be able to save yourself a huge amount of effort whenever you need to detect and manipulate text strings.

Ch9: Handling Events

In this chapter, you'll see how to use event handlers to work with windows, capture mouse movements and clicks, deal with form events, and react when the user presses keys on the keyboard.

Ch10: JavaScript and Cookies

Cookie: a unique nugget of information that a web server gives to your browser when the two first meet and which they then share with each return visit. The remote server saves its part of the cookie and the information it contains about you; your browser does the same, as a plain text file stored on your computer's hard disk.

Ch11: Objects and the DOM

Node manipulation is the W3C-recommended way for standards-compliant browsers to support web pages that act more like applications than the standard static pages. In this chapter, you'll learn a bit more about nodes and the DOM; add, delete, and work with specific nodes; and insert and replace nodes on your pages.

Ch12: Making Your Pages Dynamic

In this chapter you'll learn how to use JavaScript to display the local date and time on your Web pages; customize a greeting by the time of day wheere your user is; convert between different time formats; and move an object across the user's page under script control.

Ch13: Introducing AJAX

In this chapter you'll learn how to request information from the server in the background and turn it into a form your Ajax application can use; automatically refresh from the server; build a cool previewing effect for objects on your page; and build an Ajax application that auto-completes form fields, just like a desktop application.

Ch14: AJAX Toolkits

This chapter shows you how to take advantage of Ajax toolkits: prewritten, already-programmed libraries of functions that make it easy for you to bring the power of Ajax to your projects. For this chapter, we're using YUI. In this chapter, we'll show you how to use YUI to enable the user to drag-and-drop page elements; add calendary objects; create overlays and pop-up windows; add cool animation effects to your pages; and embed a light-weight debugger right in your page to help you create your applications.

Ch15: Applied JavaScript

The tasks you'll find here require a variety of approaches and are similar to what you'll need to do on your own Web sites. In this chapter, you'll learn to improve your site's user interface with outline-style sliding and fly-out menus; create a slideshow; process text by crunching it with JavaScript; let JavaScript do the hard work of displaying data in an easy-to-understand graphical manner; and switch between different style sheets under script control.

Ch16: Designing with Ajax

In this chapter, we'll be talking about the Web look and feel: both how it's created and why it's used. In order to demonstrate these elements, we'll be using another JavaScript library-jQuery-and you'll get a brief introduction to its advantages and uses. You'll learn how to highlight elements, create accordian-like menus, and display modal dialogs (with accompanying visual effects). We'll finish off with smarter tables, including both zebra-striping (for ease of reading) and sorting by any column.

Ch17: Bookmarklets

Bookmarklets are bookmarks that contain a call to the browser's JavaScript interpreter, insteand of an external URL. The JavaScript in you bookmarklets can do anything from getting details about images, to giving you the definition of a word, to resizing your browser window. This functionality is easy to add to make your browser a smarter, better tool. In this chapter, you'll get introduced to a variety of useful bookmarklets.