Chapter 2. USING VARIABLES AND BUILT-IN FUNCTIONS TO UPDATE YOUR WEB PAGES AUTOMATICALLY
With JavaScript you can update the content of your pages automatically—every day, every hour, or every second. In this chapter, I'll focus on a simple script that automatically changes the date on your web page.
Along the way you'll 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
How to use JavaScript functions to write information to your web page
Before getting into the nuts and bolts of functions and variables, let's take a look at a couple of examples of web pages that automatically update themselves, starting with the European Space Agency (http://www.esa.int ...
Get The Book of JavaScript, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.