script for IE redirect

by 8 replies
10
Alright I don't know about you but I personally would like to see all versions of Internet Explorer slit it's own throat and drown in a puddle of its own blood. As a graphic designer and amateur web developer I feel that if 4 out of 5 major browsers are able to render my website reasonably accurate, I shouldn't have to baby another browser.

What I want to do is for anyone using ANY version of Internet Explorer, to redirect it to a better browser.org *btw, this site is being lame, I can't post links*

I've tried the following script:

<script type="text/javascript">
if (navigator.userAgent.match("MSIE")) {
window.location = "better browser .org site, i'd type the actual site but this site is being jewish and won't let me type in links";
}
</script>

Works for the most part except for one small problem. IE likes blocking script....because it's a little bitch of a browser and needs to hang itself. I'd roll with this but I'm a freelance designer targeting small businesses. Most people running small businesses are windows users who don't know any better and use IE and wouldn't think to click "run script" down near the warning that pops up at the bottom.

Any thoughts?
#website design #redirect #script
  • Although scoffing at 20% of your traffic is usually considered a very poor business decision, if you really want to go with it, don't use javascript redirects.

    Use PHP and check your visitor's user agent with the Super Variable: $_SERVER['HTTP_USER_AGENT']

    You can use that to check for anything that has MSIE in it and then use header() to send them somewhere else.
    • [1] reply
    • so if I wanted to create an alert, not redirect...based on browser usage. EXACTLY how would that look in the header? I'm fine with HTML and CSS but more advanced code like this is japanese to me.

      And I don't consider it scoffing, I consider it guiding.
      • [1] reply

Next Topics on Trending Feed

  • 10

    Alright I don't know about you but I personally would like to see all versions of Internet Explorer slit it's own throat and drown in a puddle of its own blood. As a graphic designer and amateur web developer I feel that if 4 out of 5 major browsers are able to render my website reasonably accurate, I shouldn't have to baby another browser. What I want to do is for anyone using ANY version of Internet Explorer, to redirect it to a better browser.org *btw, this site is being lame, I can't post links*