Lesson 3: The Script and Its Effect



The Script

<SCRIPT LANGUAGE="javascript">
document.write("The background color of this page is <B>" +document.bgColor+ "</B>.")
document.write("<BR>The foreground (or text) color of this page is <B>" +document.fgColor+ "</B>.")
document.write("<BR>The link color of this page is <B>" +document.linkColor+ "</B>.")
document.write("<BR>The active link color of this page is <B>" +document.alinkColor+ "</B>.")
document.write("<BR>The visited link color of this page is <B>" +document.vlinkColor+ "</B>.")
document.write("<BR>The URL of this page is <B>" +document.location+ "</B>.")
document.write("<BR>The page you were at before this page was <B>" +document.referrer+ "</B>.")
document.write("<BR>Here's what's written in the TITLE of this page: <B>" +document.title+ "</B>.")
document.write("<BR>The document was last modified: <B>" +document.lastModified+ "</B>.")
</SCRIPT>

<SCRIPT LANGUAGE="javascript">
document.write("You are using <B>" +navigator.appName+ ".</B><BR>")
document.write("It is version " +navigator.appVersion+ ".<BR>")
document.write("Its code name is " +navigator.appCodeName+ ".<BR>")
document.write("It sends the header " +navigator.userAgent+ "." );
</SCRIPT>

<SCRIPT LANGUAGE="javascript">
document.write("You have visited " +history.length+ " pages before this one.")
</SCRIPT>

<SCRIPT LANGUAGE="javascript">
document.write("The name of this location is <B>" + location.host + "</B>." )
</SCRIPT>

<SCRIPT LANGUAGE="javascript">
document.write("The name of this location is <B>" + location.hostname + "</B>." )
</SCRIPT>

The Script's Effect





 

Back to the Index Page