Web Teacher Software
web database
Javacript 
Tutorial
CGI tutorial
web 
database consulting
web database training
contact us about web 
database software
press
Hosted Database Solutions
webteacher home
Web Teacher Consulting

javascript tutorial graphic


Webteacher Software now offers

Writing to a document

With just a little creativity, you can have JavaScript create fully formatted web pages on the fly.

Please enter your first name
What city/town do you live in?
How old are you?
Name another person in your house

Here is the code for that page generator.

function MakePage(name,town,roommate,age) {

var content = '<HTML><HEAD><TITLE>'+name+'\'s Page</title>' +
'</head><body background="images/space.gif" text="yellow" link="#FFBBBB" vlink="#FFBBBB">' +
'<FONT COLOR="4EEA6C"><center><h1>' +
name + '\'s Page</h1></center></FONT>' +
'<IMG ALIGN=Left SRC="http://images.webteacher.com/javascript/images/heart.gif" WIDTH="72" HEIGHT="72">Hello, and welcome to my page. I live in ' + town + ' and I am ' + age + ' years old.' +
'<p>' + town + ' isn\'t a bad place to live, if you can stand ' + roommate + '\'s cooking <P>' +
'Some people think they\'re so cool just because they created a home page. <br> ' +
'They have fancy backgrounds and colors, but they just go on and on with nothing to say. <br> ' +
'<A HREF="http://www.yahoo.com/">Click Here to search Yahoo</A><--Boy, there\'s a link I never' +
' would have found on my own. Some people\'s pages are so boring I think my computer could do' +
' a better job with a 10 line program.'

document.open()
document.write(content)
document.close()

}

On to Chapter 6-Events

Home | WebData - Web Database Software | Javascript | CGI | Consulting | Map Builder | Contact Us | The Press Room