Beginning Web Programming - Code Examples

Back to main book index

Chapter 11: Learning JavaScript

Here are the examples for Chapter 11, which introduces JavaScript.

ch11-eg01.htmlA first JavaScript using the document.write() method
ch11-eg02.htmlTry It Out - Text from an external file
ch11-eg03.htmlAccessing form data
ch11-eg04.htmlA simple image rollover
ch11-eg05.htmlA function to calculate the area of a rectangle
ch11-eg06.htmlIf conditional statement (only says Good Morning if the clock on your computer is before 12 am - otherwise blank).
ch11-eg07.htmlIf Else conditional statement If (Good morning or Good afternoon)
ch11-eg08.htmlSelect Case conditional statement
ch11-eg09.htmlWhile Loop
ch11-eg10.htmlDo While Loop
ch11-eg11.htmlFor Loop (1)
ch11-eg12.htmlFor Loop (2)
ch11-eg13.htmlString object - big() method and length property
ch11-eg14.htmlMaking a substring uppercase
ch11-eg15.htmlDate object (days of the year left)
ch11-eg16.htmlMath object
ch11-eg17.htmlArray object
ch11-eg18.htmlWindow object

Exercises

Exercise 15 times table
Exercise 2Time of day