script for IE redirect

8 replies
  • WEB DESIGN
  • |
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?
#redirect #script
  • Profile picture of the author ALicenseToCode
    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.
    {{ DiscussionBoard.errors[6593802].message }}
    • Profile picture of the author OneWithTheShark
      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.
      {{ DiscussionBoard.errors[6597663].message }}
      • Profile picture of the author OneWithTheShark
        The reason I've being very persistent with this solution is this.
        1. If need be, I can create a website for client using DreamWeaver, it doesn't seem to have any compatibility problems with IE and I can tweak it once it's exported.

        2. As a graphic designer, you sit down with clients and it's a listening session. I listen to what they want and in return they should theoretically be listening to what I have to say to meet them at a solution that works for them or else what are they paying me for?? If they are hard set on something in particular whether it's a good solution or a bad solution graphically, that's fine. But I would expect them to at least be open minded about my opinion and what I think may be a better solution for them. In theory, they ARE coming to me for MY opinion.

        So really I'd prefer to at least code an alert that explains in a professional manner that I do not recommend the use of this browser and for a safer and smoother experience on other websites use one of the following..

        I figure this: if they aren't going to be open minded enough to close out one browser and open another one (or download for that matter, it takes less than a minute in most cases) then that tells me they won't be open minded to something a little more complex such as a professional suggestion regarding the look of their business.

        Just my 2 cents. This really isn't un common, I know of several Ad Agency's that will actually pass off work to other freelance designers because they don't want to deal with the client. At least by creating an alert, they're the ones who are passing me off as opposed to a big time Agency passing the client off.
        {{ DiscussionBoard.errors[6597958].message }}
        • Profile picture of the author Brandon Tanner
          I hope this isn't a website that you make money from, because if it is... then needless to say... doing this is NOT gonna be good for your conversion rate!

          But if you still want to do it, just put the following code very first thing inside the <head> section....

          <!--[if IE]><meta HTTP-EQUIV="REFRESH" content="0; url=http://www.YourRedirectURLHere.com"><![endif]-->


          And change the part in red to the URL you want to redirect to.

          Or if you'd rather just show them a JS alert instead of redirecting them, then you can do this instead...

          <!--[if IE]><script type="text/javascript">alert("Your browser sucks!");</script><![endif]-->

          The alert won't work if they have JS disabled, obviously, so something to keep in mind. If you want to reach your IE users that have JS disabled, then put this somewhere in the <body> section...

          <noscript><!--[if IE]><h1>IE user with Javascript disabled??? WTH are you thinking??? ( - ; </h1><![endif]--></noscript>
          Signature

          {{ DiscussionBoard.errors[6598380].message }}
          • Profile picture of the author OneWithTheShark
            what do you mean conversion rate? And technically, no, no one is purchasing anything directly from the site. This is my freelance and portfolio page (still a work in progress of course). So they have to contact me to get a quote for anything. Chances are I'll be meeting most clients in person before they ever see my site and based on a recent study, most internet users have already steered away from using IE and have moved on to better browsers.

            as of right now, this is what I have set up if you were to visit my site using IE.
            just type in blackbird - graphics and then .com I still can't list links here so ignore the spaces but don't forget the dash.
            {{ DiscussionBoard.errors[6598845].message }}
            • Profile picture of the author OneWithTheShark
              or, if someone wants to go to that website, analyze my code and figure out why IE is tearing my site apart they're welcome to it. I'm far more experienced in print design than I am in web. Like I said earlier, until I get masterful at this part of design, I can just use Dreamweaver.
              {{ DiscussionBoard.errors[6598856].message }}
              • Profile picture of the author Brandon Tanner
                "Conversion rate" means the percentage of your site's visitors that become paying customers. Anything you do that sends your visitors AWAY from your site (such as suggesting that they go download a different browser) is going to have a negative effect on your conversion rate. Trust me on that one!

                Not to mention... why would someone want to hire you to build their website if they think that you can't even make your own website look good in IE?

                Anyways, I took a quick look at your site via Firebug (<-- essential if you do web design!), and the first thing that sticks out to me is... it looks like you are using fixed heights for a LOT of your div's that should be fluid. That will make your div's "overlap" with each other, which will cause all kinds of layout issues in certain browsers. I see some other things too, but that's the biggie.

                If you don't have a clear understanding of how CSS layouts and div positioning works, then it might be easier for you to start from scratch with a design that already is standards-compliant (read: looks and functions correctly in all of the major browsers), than to fix what you've got there. And it would be a lot easier to maintain in the long run too.

                There's tons of standards-compliant templates out there... most of the modern XHTML/CSS or HTML5 templates look great in all of the major browsers. So you might want to consider that option.
                Signature

                {{ DiscussionBoard.errors[6599419].message }}
                • Profile picture of the author OneWithTheShark
                  Originally Posted by Brandon Tanner View Post

                  "Conversion rate" means the percentage of your site's visitors that become paying customers. Anything you do that sends your visitors AWAY from your site (such as suggesting that they go download a different browser) is going to have a negative effect on your conversion rate. Trust me on that one!

                  Not to mention... why would someone want to hire you to build their website if they think that you can't even make your own website look good in IE?

                  Anyways, I took a quick look at your site via Firebug (<-- essential if you do web design!), and the first thing that sticks out to me is... it looks like you are using fixed heights for a LOT of your div's that should be fluid. That will make your div's "overlap" with each other, which will cause all kinds of layout issues in certain browsers. I see some other things too, but that's the biggie.

                  If you don't have a clear understanding of how CSS layouts and div positioning works, then it might be easier for you to start from scratch with a design that already is standards-compliant (read: looks and functions correctly in all of the major browsers), than to fix what you've got there. And it would be a lot easier to maintain in the long run too.

                  There's tons of standards-compliant templates out there... most of the modern XHTML/CSS or HTML5 templates look great in all of the major browsers. So you might want to consider that option.

                  I thought about it earlier this afternoon, as much as it kills me to bend and break, I figured I might as well figure out why it's not playing nicely. My stance on browser redirection is more of a defiance thing although you are correct in the mindset of a client. I think my defiance comes from my hatred of Microsoft.

                  So I called my friend up who makes $70k a year as a programmer and one of the BIGGEST reason IE was breaking my site up in several spots was I needed to go in to the style sheet and specify img{border:none;} that damn simple. The javascript I had for prompting IE users has been taken down. My friend found that I actually only had a few minor problems. It's funny how one thing made it look 5x worse than it really was. Considering this is my first major website I've built from the ground up without the help of Dreamweaver, I've been told I did quite well. I'll let others make that decision haha.

                  Now my only major problems are page load times with images, which I have a plan for and apparently the @font-face command is still not supported by all browsers yet. I will probably replace some of the headers with images instead because in Photoshop 'Bebas Neue' doesn't show up anywhere near as bold as some of the other browsers are displaying it.

                  I'm STILL not fully opposed to telling IE users to quit using their ****ty browser but I guess I have no choice but to baby it haha.

                  Thanks for your help.
                  {{ DiscussionBoard.errors[6600382].message }}

Trending Topics