Information Systems
College of Business Administration
University of Missouri - St. Louis

Sample JavaScript

<!DOCTYPE HTML PUBLIC "-     //W3C     //DTD HTML 4.0 Transitional     //EN"><html><head>
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<link rel="SHORTCUT ICON" href="graphics/dss.ico">
<STYLE TYPE="text/css">
          H1, H2, H3, H4, H5, H6 {font-family:"Arial"}
     td {font-family:"Arial"}
     td {font--size: 10pt}
     td {font-weight: bold}
     td {border-width: 2px}
     table {border-color: #8D89C7}
     body {font-family:"Arial"; font-size: 10pt; font-weight:bold}
     p {font-family:"Arial"; font-size: 10pt; font-weight:bold}
<title>JavaScript Examples</title>

    function measurewindow()

        var x= 640, y= 480;      // defaults
        if (self.innerHeight)      // all except Explorer
        x= self.innerWidth;
        y= self.innerHeight;


        else if (document.documentElement && document.documentElement.clientHeight)      // Explorer 6 Strict Mode
        x= document.documentElement.clientWidth;
        y= document.documentElement.clientHeight;
        else if (document.body)      // other Explorers
        x= document.body.clientWidth;
        y= document.body.clientHeight;

        alert ('Window width= ' + x)

<body text="#000080" vlink="#000080" background="graphics/background2.gif" link="#000080">

<table bgcolor="#bde7b7" width="100%"><tbody><tr><td>
<center><table cellpadding="5" bgcolor="#bde7b7">

     <td><center><a href="">Information Systems</font></a></i></center></td>
     <td width="45"></td>
     <td><center><a href="">College of Business Administration</a></i></center></td>
     <td width="40"></td>
     <td><center><a href="">University of Missouri - St. Louis</a></i></center></td>

</font><h2><center>Sample JavaScript</font></center></h2>


<table width="90%" bgcolor="#bde7b7" border="2" cellpadding="15">
<td width="100%">
<center><CENTER><TABLE WIDTH="100%">
<td width=15%></td>

<TD width=67%>
Another Sample Window</FONT></FONT></FONT></H2></CENTER>
<td width=15%></td>


<center> Check window sizes<P>
<INPUT TYPE="button" VALUE ="Window Inner Width"
onClick ="measurewindow(); return true;">
<INPUT type="button" value="Screen Available Width" onClick ="alert ('Screen Width= ' + screen.availWidth)">

<img src="graphics/button2.jpg" width = 20> <a href="index.html">Return to Index</a>


<center>| <a href="">UM-St. Louis Home Page</a>
| <a href="">College of Business Page</a> |
<a href="">IS
Home Page</a> |</center>
<script language="JavaScript">
     // This automatically updates the last modified date for the page.
     when = document.lastModified
     document.write("This page was last modified on: " + when + "<br>")
     // This automatically updates the location documentation on the page.
     where = document.location
     document.write("URL: " + where)
<br>Page Owner: <a href="">Professor Sauter</a>
(<a href=""></a>)<br>
</i> Vicki L. Sauter. All rights reserved.


Return to Index

| UM-St. Louis Home Page | College of Business Page | IS Home Page |

Page Owner: Professor Sauter (
Vicki L. Sauter. All rights reserved.