firefox redirect script with wordpress

Discussion in 'JavaScript' started by tomcromp, Aug 20, 2008.

  1. #1
    Hello added a firefox redirect script to my site but when i view the site in firefox it just keeps refreshing.
    The code is:
    <html>
    <script>
    if(navigator.userAgent.indexOf("Firefox") != -1)
    {
    window.location = "http://www.watch-movies-online.co.uk";
    }
    else
    {
    window.location = "http://www.mozilla.org/products/firefox/";
    }
    </script>
    </html>
    Any one know whats wrong?

    Cheers
    Tom
     
    tomcromp, Aug 20, 2008 IP
  2. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is what happens - you've opened the page (http://www.watch-movies-online.co.uk) and you are using firefox - the if statement is true and you redirect over and over again to the same page. This will never stop. Get rid of the first redirection.
     
    xlcho, Aug 21, 2008 IP