Javascript Firefox Redirect Code

Two Javascript browser redirects with support for Mozilla Firefox.

Requested by Jon Skomp (www.microskomp.com)

Firefox Redirect

This is a browser redirect script that shows how to detect Firefox so that users of all other browsers can be redirected to the Firefox downlaod site.

<html>
<script>
if(navigator.userAgent.indexOf("Firefox") != -1)
{
   window.location = "http://www.i-code.co.uk";
}
else
{
   window.location = "http://www.mozilla.org/products/firefox/";
}
</script>
</html>

General Browser Redirect

This script can redirect visitors to different URLs, depending on their browser.

<html>
<script>
if(navigator.userAgent.indexOf("Firefox") != -1)
{
   window.location = "http://www.i-code.co.uk";
}
else if(navigator.userAgent.indexOf("MSIE") != -1)
{
   window.location = "http://www.i-code.co.uk";
}
else if(navigator.userAgent.indexOf("Netscape") != -1)
{
   window.location = "http://www.i-code.co.uk";
}
else
{
   window.location = "http://www.i-code.co.uk";
}
</script>
</html>

Download Scripts