Hey Im trying to redirect users using anything BUT firefox, and if they are using firefox to just continue on threw the site. So something like. <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>
Have a read of this page...http://developer.yahoo.com/yui/examples/yahoo/yahoo_ua_detection.html If it was up to me I would include the YUI library like so... <script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js"></script> HTML: and then use the example that's given... if (YAHOO.env.ua.gecko > 0) {} // e.g. Firefox if (YAHOO.env.ua.ie > 0) {} // Microsoft Internet Explorer // Or leverage boolean coercion -- 0 evaulates as false if (YAHOO.env.ua.opera) {} // Opera if (YAHOO.env.ua.webkit) {} // Safari, Webkit HTML: I'm not 100% sure what you mean by the quote you added? But you could use a switch statement that will allow your code to exit and skip to the end. Can I ask why you want to redirect based on the browser?
Im having it on a free web hosting site. I dont want to give a redirection to users with firefox, i just want them to *Pass* threw, you know what i mean?