Use JavaScript variables and built-in functions to update your Web pages automatically

Source: No Starch Press

Favorite

Free registration required

Focus on a simple script that automatically changes the date on your Web page in this sample chapter from The Book of JavaScript, 2nd Edition. Along the way, learn how JavaScript uses variables to remember simple items such as names and numbers; how JavaScript keeps track of more complicated items such as dates; and how to use JavaScript functions to write information to your Web page. First take a look at a couple of examples of Web pages that automatically update themselves, then get to the nuts and bolts of functions and variables. By the end of the chapter, you will have learned how to declare and use variables (use var the first time and use valid and descriptive variable names). You will also have learned how to write to web pages with document.write(), and finally, you will know how to get the current date from JavaScript with the Date() object and its various methods.



Title: The Book of JavaScript, 2nd Edition
ISBN: 1593271069
Published: December 2006
Author: thau!
Chapter: Chapter 2: Using Variables and Built-In Functions to Update Your Web Pages Automatically
Published by No Starch Press

Format:PDF Size:594.00
Version:1.0 Date:Dec 2006
Price:0.00 Downloads:2481