JavaScript Output
Once your Web page has been displayed in the Browser window it is not possible to change it. If you want something different to appear on the screen (ie some form of "output") there are several approaches:
1. Write JavaScript to Reload the page. (This has the same effect
as pressing the Browser "Reload/Refresh" button.)
2. Write to the Status Line (The last line at the bottom of
the Browser window.) with: window.status =
"my Output".
3. Use the alert( ), confirm( ), or prompt(
) methods.
4. Create a 'pop-up' window.
5. Use a Form object.
Each of these approaches will be presented in the following screens. An emphasis will be placed on using Forms as it is this area where JavaScript really shines. Forms also allow for user Input.
NOTE: It is easiest to demonstrate how to use these
approaches if we do so using "Buttons"
as the event triggers. The following screens will therefore start out with Forms and then move on to the other
four approaches. (Forms will be revisited later in this tutorial.)