[Overview] [Basics] [More] [Fun] [Class 2] [If] [Functions] [Timing] [Queries] [References] [Examples] [Libraries] [Assignments]
This page provides a "custom" name (and, in certain cases, a custom link).
It serves as an illustration of the JavaScript conditional (if)
statement. Try entering "Fred" and "SamR" to see differences.
<script language="javascript1.1">
var person = prompt("What is your name?", "");
document.write("<h2>Custom page for " + person + "</h2>");
if (person == "SamR") {
document.write('<p><a href="http://www.math.grin.edu/">Visit the dept.</a></p>');
}
</script>
[Overview] [Basics] [More] [Fun] [Class 2] [If] [Functions] [Timing] [Queries] [References] [Examples] [Libraries] [Assignments]
Source text written by Samuel A. Rebelsky.
This page may be found at http://www.math.grin.edu/~rebelsky/Tutorials/JavaScript/Spring1999/Examples/custompage.html
Source text last modified Wed Apr 14 12:13:50 1999.
This page generated on Wed Apr 14 12:19:57 1999 by SiteWeaver. Validate this page's HTML.