Announcement Announcement Module
Collapse
No announcement yet.
Browser Detections and Redirection Page Title Module
Move Remove Collapse
Search Search Module
Collapse

Advertisement Advertisement Module
Collapse

Featured Images Featured Images Module
Collapse

Mediabistro Creative Sites Mediabistro Creative Sites Module
Collapse
Latest Topics Latest Topics Module
Collapse

Advertisement Advertisement Module
Collapse

Sponsors Sponsors Module
Collapse

X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Browser Detections and Redirection

    I have created this site - http://www.dragonflyfrms.com/

    It includes some coding and ".png" files that are not compatible with IE6 (and probably older). There for I created another set of pages for older sites (http://www.dragonflyfrms.com/styleb/indexb.htm).

    I did some looking around to try to find javascript that would detect older browsers and if needed redirect to the second set of pages. So far, at the moment this is what I have:

    <script type="text/javascript">
    var browser = navigator.appName;
    var b_version = navigator.appVersion;
    var version = parseFloat( b_version );
    var is_explorer7 = false;
    var position = b_version.indexOf( "MSIE 7." );
    if( position != -1 )
    {
    is_explorer7 = true;
    }

    if ( browser == "Microsoft Internet Explorer" )
    {
    if ( version >= 6 || is_explorer7 )
    {
    document.location.href="http://www.dragonflyfrms.com/"
    }
    else
    {
    document.location.href="http://www.dragonflyfrms.com/styleb/indexb.htm"
    }
    </script>

    I have it in the header tags of the initial page, but when I test in IE5.5 the page is not redirected.

    - Do I need to specify for each older version of IE, or can I have it simply detect for anything older the 7?
    - Do I need to have an "onload function" with in the body tag?
    - Is my script completely off, if so how do I make it work?

    Thank you for any help ahead of time.

  • #2
    Do you really have THAT many people hitting up your site using IE6?
    Professional Pixel Pusher Designing the world around you. | Working daily to reach 10,000 hours of practice.

    Comment


    • #3
      I think you may be surprised by how many people use IE6 at work.

      Dig did a survey a couple weeks ago
      http://digg.com/d3wK0V

      I just checked the stats of a site that I run for a restaurant.
      Traffic is high Monday - Friday when people are at work looking for lunch options.

      64&#37; of the sites traffic comes from IE
      Almost a third of that is still IE6
      Some advice is profound, some is clever. The above post is a good example of both.
      http://www.pedrospracticaljokes.blogspot.com/

      Comment


      • #4
        If you are talking about inline images then transparency can be forced using Javascript in IE6 rather then using separate pages.

        On the other hand, if you are talking bacground images use a IE6 specific selector to override the default background images for the browser.

        HTML Code:
        #my-div {
          background: #fff url(/img/default_image.png) no-repeat top left;
        }
        
        * html #my-div {
          background: #fff url(/img/ie_image.png) no-repeat top left;
        }

        Comment


        • #5
          I agree that it would nice if we could get everyone to update there browser. Like MD, I to have to use IE6 at work, and they frown upon any "unauthorized" installs.

          In this particular case, my client is getting some feedback from potential customers about readability. It is primarily a rural community that is not all that tech savvy, as far as knowing to upgrade (or asking them to upgrade) there browser.

          tZ, it is not for a background image. I'm not so sure if you would consider them inline either, because I am using fixed and absolute positioning properties. I will look into that a bit more though. I could switch some of the .png's to .gif's Other factors that may or may not come into play if I try to stay with one set of pages include: a drop shadow on the menu background, my bottom image is suppose to stay anchored to the bottom of the window (not happening in IE6), plus I am using various z-indexes.

          My thought is that it may be just easier to create the second set of pages, which I did do already (there were only 6 or seven of them).

          Comment


          • #6
            What tZ said.

            Also, if you really do need to specifically target old versions of IE, conditional comments are a far, far better option than browser sniffing.

            Comment


            • #7
              Originally posted by CkretAjint View Post
              Do you really have THAT many people hitting up your site using IE6?
              Sadly, I'm pretty sure the majority of my company still has IE 6 installed. I do, although I use Firefox about 99% of the time.

              Comment


              • #8
                Originally posted by graffiks View Post
                tZ, it is not for a background image. I'm not so sure if you would consider them inline either, because I am using fixed and absolute positioning properties. I will look into that a bit more though. I could switch some of the .png's to .gif's Other factors that may or may not come into play if I try to stay with one set of pages include: a drop shadow on the menu background, my bottom image is suppose to stay anchored to the bottom of the window (not happening in IE6), plus I am using various z-indexes.
                If they're not background images, just use PNGFix

                Comment


                • #9
                  Thanks hewligan. It looks like that would help with the transparency issues. How about getting the images locked to the bottom of the page?

                  Comment


                  • #10
                    Originally posted by graffiks View Post
                    Thanks hewligan. It looks like that would help with the transparency issues. How about getting the images locked to the bottom of the page?
                    http://www.cssplay.co.uk/layouts/fixed.html

                    I don't actually have IE6 available to try it on, but the CSS Play stuff is usually pretty reliable.

                    Comment


                    • #11
                      I know it's been a bit since this has been posted, but I've been trying to play around to get the suggest code of the CSS Play. I still can't seem to get the images that I need to stay at the bottom of the page to stay there. I then decided to try out the actual link http://www.cssplay.co.uk/layouts/fixed.html on the other machine that I am testing on, and it doesn't work either.

                      Right now I do see that the cssplay page has a javascript code in the heading tags calling for IE6. I'm not quite sure if that ties in. The machine I am trying to test with is using IE 5.5. Does that make a difference in this particular instance?

                      If I can't get this fixed positioning to work, I may still need to figure out the browser detection and redirect question.

                      Thanks in advanced for any suggestions.

                      Comment


                      • #12
                        Here's are mid-western business breakdown of EI over the past month.
                        1. 7.0 844 59.23&#37;
                        2. 8.0 338 23.72%
                        3. 6.0 241 16.91%
                        4. 5.5 2 0.14%
                        Less be more.

                        Comment


                        • #13
                          Over the past year:
                          1. 7.0 10,002 72.55&#37;
                          2. 6.0 2,999 21.75%
                          3. 8.0 781 5.67%
                          4. 5.5 3 0.02%
                          5. 5.01 1 0.01%
                          Less be more.

                          Comment


                          • #14
                            Yup.

                            IE 5.5 hasn't even been supported by Microsoft for years. Anyone running it needs to upgrade badly - for far more important reasons than any web site I might create.

                            I also won't support Babbage's Difference Engine

                            Comment

                            Mediabistro A division of Prometheus Global Media home | site map | advertising/sponsorships | careers | contact us | help courses | browse jobs | freelancers | content | member benefits | reprints & permissions terms of use | privacy policy Copyright © 2014 Mediabistro Inc. call (212) 389-2000 or email us
                            Working...
                            X