Shoutbox

Detecting Web Browser - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Detecting Web Browser (/showthread.php?tid=49931)

Detecting Web Browser by user27089 on 09-03-2005 at 12:13 PM

I'm not sure if this is possible, but:

I have re-designed the Messenger Plus! Support website, and it didn't work very well in Internet Explorer or Opera, so what I did, was create a new folder, called "IE", which runs perfectly fine in IE & Opera. Is there anyway that I could automatically send those with IE/Opera to http://www.mpsupport.net/ie/ rather than http://www.mpsupport.net/index.php?

I don't mind what type of code is used... Saral has a code similar to this, where, if the person is using Internet Explorer, then the image that is a .png changes to a .gif, so it is still transparent.


RE: Detecting Web Browser by Zephyr on 09-03-2005 at 12:22 PM

You can use these javascript codes:

code:
<html>
<script>
if(navigator.userAgent.indexOf("Firefox") != -1)
{
   window.location = "http://www.mpsupport.net/index.php";
}
else
{
   window.location = "http://www.mpsupport.net/ie/";
}
</script>
</html>


This will detect whether firefox is the browser and go to  http://www.mpsupport.net/index.php. If firefox is not detected then it will go to http://www.mpsupport.net/ie/.

You can also use this for certain browsers.

code:
<html>
<script>
if(navigator.userAgent.indexOf("Firefox") != -1)
{
   window.location = "http://www.mpsupport.net/index.php";
}
else if(navigator.userAgent.indexOf("MSIE") != -1)
{
   window.location = "http://www.mpsupport.net/ie/";
}
else if(navigator.userAgent.indexOf("Netscape") != -1)
{
   window.location = "http://www.mpsupport.net/ie/";
}
else
{
   window.location = "http://www.mpsupport.net/ie/";
}
</script>
</html>



RE: Detecting Web Browser by Yousef on 09-03-2005 at 12:37 PM

I don't think this is a good way to do it. You'd better make the code ie-compatible. I could help you, ask me on msn :)


RE: Detecting Web Browser by user27089 on 09-03-2005 at 12:38 PM

I prefer using PNG images though and having a better quality website, it is fine how it is, just doing some testing in Opera now...

Thanks for the off Juzzi, but no thanks...

Fixed it all now thanks.

http://www.mpsupport.net

try it out!