JavaScript Conditional Statements

This page uses a condition statement (if-then-else) to check for either the Netscape or IE browser. A different document is "written" depending on which condition is satisfied:

Here's how the statement looks:

if (navigator.appName == "Netscape") { document.write("This page is best viewed in Internet Explorer. If you are running Netscape Versions 4.7 or earlier, we suggest you switch to IE to see all the great features on this site.") }

else

{ document.write ("<font face ='comic sans ms, verdana, arial, sans-serif' size ='-2' color='blue'><i>Site best viewed in Internet Explorer.</i></font>") }