Screen Object

Navigator Object

Source Code

<script type="text/javascript">
  //<![CDATA[

  // display current browser information
  // code based on example in "Learning JavaScript, Second Edition"

  function output(id, text) {
      var obj = document.getElementById(id);
      obj.appendChild(document.createTextNode(text));
      obj.appendChild(document.createElement('br'));
  }

  window.onload=function () {
      output('screenObject', 'screen.availTop: '+screen.availTop);
      output('screenObject', 'screen.availLeft: '+screen.availLeft);
      output('screenObject', 'screen.availWidth: '+screen.availWidth);
      output('screenObject', 'screen.availHeight: '+screen.availHeight);
      output('screenObject', 'screen.colorDepth: '+screen.colorDepth);
      output('screenObject', 'screen.pixelDepth: '+screen.pixelDepth);

      output('navigatorObject', 'navigator.userAgent: '+navigator.userAgent);
      output('navigatorObject', 'navigator.appName: '+navigator.appName);
      output('navigatorObject', 'navigator.appCodeName: '+navigator.appCodeName);
      output('navigatorObject', 'navigator.appVersion: '+navigator.appVersion);
      output('navigatorObject', 'navigator.appMinorVersion: '+navigator.appMinorVersion);
      output('navigatorObject', 'navigator.platform: '+navigator.platform);
      output('navigatorObject', 'navigator.cookieEnabled: '+navigator.cookieEnabled);
      output('navigatorObject', 'navigator.onLine: '+navigator.onLine);
      output('navigatorObject', 'navigator.userLanguage: '+navigator.userLanguage);
      if (navigator.mimeTypes) {
          output('navigatorObject', 'navigator.mimeTypes[1].description: '+navigator.mimeTypes[1].description);
          output('navigatorObject', 'navigator.mimeTypes[1].type: '+navigator.mimeTypes[1].type);
      }
      if (navigator.plugins) {
          for (var i = 0; i<navigator.plugins.length; i++) {
              output('navigatorObject', 'navigator.plugins[' + i + '].description: ' + navigator.plugins[' + i + '].description);
          }
      }

      document.onclick=function () {
          history.back();
          return false;
      }
  }

  //]]>
</script>

<h1>Screen Object</h1>

<div id="screenObject">
</div>

<h1>Navigator Object</h1>

<div id="navigatorObject">
</div>