Results 1 to 6 of 6

Thread: Redirect based upon IE6 or IE7

  1. #1
    Join Date
    Feb 2008
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Redirect based upon IE6 or IE7

    Hey guys! Question for you. I have an HTML dashboard, as some of you know, that I maintain for my company. On the dashboard, I display separate .gif images in cells of the dashboard table. This has worked fine in the past, and continues to work fine. The problem is, the gif images are grainy.

    I've been experimenting with the .png file extension and the quality of the images is WAY better. Problem is, <IE7 displays the background of .png files grey, rather than transparent.

    I found out that some associates in our company actually use IE7 and some are still on IE6. I'd like to be able to redirect the users, based upon their browser version (no one uses anything but Internet Explorer...the company is also an intranet site...so 6 and 7 are the only versions to worry with).

    I can create 2 dashboards. One that uses .png files for the images and one that uses .gif files.

    I currently have a redirect page that shows a loading bar when the site is accessed. Within this loading page, I'd like to put some redirect script that sends users with IE6 to the .gif dashboard and users with IE7 to the .png dashboard.

    Does anyone have any thoughts?

    Thanks!
    -Hum

  2. #2
    Join Date
    Feb 2008
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    So I guess the script would be something like this? Can anyone tell me if this looks right? I tried to modify the script off of the Dynamic Drive sripts site.

    <script>

    var browser_type=navigator.appName
    var browser_version=parseInt(navigator.appVersion)

    //if IE 6
    if (browser_type=="Microsoft Internet Explorer"&&browser_version=6)
    window.location.replace("http://dashboard.gif.com")
    //if IE 7
    else if (browser_type=="Microsoft Internet Explorer"&&browser_version=7)
    window.location.replace("http://dashboard.png.com")
    //Default goto page (NOT IE 6 and NOT IE 7)
    else
    window.location="http://dashboard.gif.com"
    </script>

  3. #3
    Join Date
    Feb 2008
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Any ideas?

  4. #4
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Use conditional statements for IE6 & 7. Something like this:
    Code:
    <script type="text/javascript">
    function bla(){window.location="http://dashboard.gif.com"}
    </script>
    
    <!--[if IE 6]>
    <script type="text/javascript">
    function bla(){window.location.replace("http://dashboard.gif.com")}
    </script>
    <![endif]-->
    
    <!--[if IE 7]>
    <script type="text/javascript">
    function bla(){window.location.replace("http://dashboard.png.com")}
    </script>
    <![endif]-->
    Arie Molendijk
    Last edited by molendijk; 03-07-2008 at 02:50 PM. Reason: Correction

  5. #5
    Join Date
    Apr 2007
    Location
    London
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Can anyone tell me which one of this 2 to use ?

  6. #6
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Both (would) work, but I prefer to use that of molendjk.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •