SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure if this is the right forum,
    but this is what i need to do:
    i need a script that detects if a visitor is using netscape, and which will direct the visitor to either page a or page b when clicking on a link,
    is there a script that can accomplish that?
    Thanks for any help

  2. #2
    SitePoint Enthusiast Rips's Avatar
    Join Date
    Mar 2001
    Location
    London, UK
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure this is nice & easy!

    Try something like this:


    <script language="JavaScript">
    <!-- hide from older browsers

    if (document.layers) {
    // Netscape Navigator code
    window.location.href = "indexnavigator.htm";
    }

    else if (document.all) {
    // Internet Explorer code
    window.location.href = "indexie.htm";
    }

    else if (document.getElementById) {
    // Netscape 6 code
    window.location.href = "indexn6.htm";
    }

    else {
    // Unrecognised browser code
    alert("Unrecognised browser detected!");
    }

    // -->
    </script>


    It looks for differences in their implmentations of the Document Object Model, then automatically redirects.

  3. #3
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks rips,
    since i am the antichrist of coding i will probably screw this up, in that case i might have a follow-up question


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
  •