Interactive Story
Let's write a story. We need some information to get started; enter it below.
This interactive page demonstrates how JavaScript can be used to create new pages based on input from the user. The script checks whether all the required information is filled in before proceeding. It then stores the input in variables for insertion into the HTML code for the new page. The code for the new page is already written and stored in a string constant on this page. After the information is gathered, the script opens a new window and writes the completed HTML code to the new window.
If you enter new information and press Start again, the new page is generated in the new window, or re-creates the window if you closed it.
The code for the page is extensively annotated. Please help yourself, but if you use it, we would like you to give WebSorcerer credit somehow and let us know where your site is so that we can appreciate your work.
©L. A. Shadoff, 1998