incorporating browser detect into an onclick link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • topherknowles
    New Member
    • Feb 2008
    • 2

    #1

    incorporating browser detect into an onclick link

    Hello, I have a number of links opening in a fixed window that certain users cannot access because they are on netscape 4.6 (I think this can handle the links and it is actually their ancient computers which cannot, but either way they are all on netscape), the current onclick command looks like this:

    [CODE=javascript]<A onclick="wopen( 'page url', 'popup', 670, 395); return false;" href="page url" target=popup>

    which activates this script:

    <SCRIPT>
    <!--
    function wopen(url, name, w, h)
    {
    w += 32;
    h += 108;
    var win = window.open(url ,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=no, resizable=no');
    win.resizeTo(w, h);
    win.focus();
    }

    // -->
    </SCRIPT>[/CODE]

    I want to make this link detect if a user is on netscape 4.6 and redirect them to a different url if they are, or continue to the normal link if not.

    Can anybody help me out?
    Last edited by acoder; Feb 16 '08, 08:39 AM. Reason: Added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    I can't see why the code shouldn't work, but seriously who uses Netscape 4.6 nowadays? Is it not possible for them to upgrade?

    What happens on their browser? Do they see errors?

    Comment

    • topherknowles
      New Member
      • Feb 2008
      • 2

      #3
      The code does work on the browser - it is the machines that cannot handle the link that it opens so I want to auto-redirect them to a simpler, static HTML page instead.

      It is 800 poor call centre employees that are stuck on PC's from the land that time forgot.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        You don't really want to detect the browser, you want to detect the slow machine.

        You could start a timer when the initial page starts loading until it has loaded. If it takes too long, use the simple link, otherwise link to the normal URL.

        Comment

        Working...