Re-Direct upon the Browser Used

[Total: 0    Average: 0/5]

This shows how to check for the browser type and then send the user to a page appropriate for that browser.

Body Code:

<script type=text/javascript>
function doIt() {
  if (navigator.appName.indexOf("Netscape") != -1)
    window.location = "http://www.js-examples.com/";
  if (navigator.appName.indexOf("Microsoft") != -1)
    window.location = "http://www.js-examples.com/page/javascripts.html";
  else{
    document.location = "http://www.js-examples.com";
  }
}
</script> 
<a href="javascript:doIt()">Run Test and Re-Direction</a>

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *