Page does not exist.
Missing Page
Sorry. The page that you requested does not exist on the Department of Computer Science web site.
[an error occurred while processing this directive]
File: part2.shtml
Creator: George Ferguson
Created: Mon Sep 17 12:41:15 2012
Time-stamp: Sorry. The page that you requested does not exist on the Department of Computer Science web site.
Don't forget that
And don't forget: don't use
Last update: Thursday, 20-Sep-2012 13:12:43 EDT
Page does not exist.
Missing Page
[an error occurred while processing this directive]
CSC170: Introduction to Programming and the Web
Use a Javascript
Fall 2012
[an error occurred while processing this directive]
Assignment 3: Scripts in Documents: Part 2
script
element in the body of your documents to
perform the following tasks:
document.write
and
document.writeln
add HTML code to the document source (at
the point where the script
element appears). So first think
what the HTML should look like. That is, what it would be if you were
writing a static page. Then get your script to produce that HTML
using document.write
and
document.writeln
. And then use window.prompt
and variables to get the dynamic parts into the HTML that you're
adding to the document.
document.writeln
if the HTML
you are producing with that statement can't have a newline in it! If
you want to play it safe, you can always
use document.write
and then if you want a newline you use
the "\n" (backslash n) escape sequence to include a newline in a
string literal (See textbook, Section 6.3, page 192). You can also use
spaces in your string literals, of course, where they are appropriate
for the HTML you are producing.