Week 2 - 121v1a.htm

<SCRIPT>

var theURL = prompt("Please enter an HTTP Site", "http://espn.go.com");

// if theURL substring doesn't contain "http://" then add it,
// otherwise if already contains http:// we don't need to do anything
if (theURL.
substring(0,7) != "http://") theURL = "http://" + theURL ;

// use the JavaScript String Link Method to convert a String into a Hyperlink
document.
write("<CENTER>Go to " + theURL.link(theURL) + "</CENTER>");

</SCRIPT>