topical media & game development

talk show tell print

basic-javascript-05-FFOnly.htm / htm



  <html>
  <head>
  <script language="JavaScript" type="text/javascript">
  
  function getBrowserName()
  {
     var lsBrowser = navigator.userAgent;
     if (lsBrowser.indexOf("MSIE") >= 0)
     {
        lsBrowser = "MSIE";
     }
     else if (lsBrowser.indexOf("Netscape") >= 0)
     {
        lsBrowser = "Netscape";
     }
     else if (lsBrowser.indexOf("Firefox") >= 0)
     {
        lsBrowser = "Firefox";
     }
     else if (lsBrowser.indexOf("Safari") >= 0)
     {
             lsBrowser = "Safari";
     }
     else if (lsBrowser.indexOf("Opera") >= 0)
     {
             lsBrowser = "Opera"
     }
     else
     {
             lsBrowser = "UNKNOWN"
     }
     return lsBrowser;
  }
  
  function checkBrowser()
  {
     if (getBrowserName() == "MSIE")
     {
        window.location.replace("IEOnly.htm");
     }
  }
  
  </script>
  </head>
  <body onload="checkBrowser()">
  
  <H2>Welcome to the Firefox only page</H2>
  
  </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.