SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Eat, Sleep, *********! J. Pederson's Avatar
    Join Date
    Sep 2001
    Location
    Wisconsin
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Small redirect script....

    I need someone to WRITE me a simple script that will redirect a visitor to an IE5+ version and if not, redirect to an "other" page.

    It's a pretty simple script i would guess. I just don't have time to learn JavaScript.
    James Pederson - Web Design & Development
    phone: 608.243.7898
    e-mail: james@transparentacoustics.com
    websites: clear speaker box | website development madison

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <script language="JavaScript" type="text/javascript"> 
    if(document.all) { 
    // Do something for IE4 
    top.location.href="pageIE4.htm";
    } 
    else if(document.all && document.getElementById) { 
    //Do something for IE5+ 
    top.location.href="pageIE5.htm";
    
    } 
    else if(document.layers) { 
    //do something for NS4.x 
    top.location.href="pageNS4.htm";
    
    } 
    else if(document.getElementById && !document.all) { 
    //Do something for NS6+ 
    top.location.href="pageNS6.htm";
    
    } 
    else { 
    //Do something for everyone else 
    top.location.href="Other.htm";
    
    } 
    </script>
    If you want to load another page in any of those options simply put in the top.location code

    top.location.href="url"

    This will replace the current browser with the correct version...

    Hope that does it for you.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    Eat, Sleep, *********! J. Pederson's Avatar
    Join Date
    Sep 2001
    Location
    Wisconsin
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SWEEEEEET!!!

    THAT'S PERFECT!!!! YOU'RE FAST!!!
    James Pederson - Web Design & Development
    phone: 608.243.7898
    e-mail: james@transparentacoustics.com
    websites: clear speaker box | website development madison

  4. #4
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd like to see how to do this with PHP and ASP since youcan't bank on javascript working 100% of the time...

    Sketch
    Aaron Brazell
    Technosailor




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
  •