Results 1 to 5 of 5

Thread: Browser Detection Redirect ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Location
    London, England
    Posts
    213
    I am using the following code to detect the user's browser. This works fine However, how can I adapt it so that it fires off a certain html page once it has determined that the browser is IE ?

    <HTML>
    <HEAD>

    <script language="JavaScript">

    <!-- hide me

    function browserSizeUp()

    {
    var browser = navigator.appName;
    var version = versionNumber();
    var the_string = browser + " " + version;

    if (browser == "Netscape")

    {
    alert("Your Browser is Netscape, version " + version);

    } else {

    alert("Your Browser is Internet Explorer, version " + version);
    }
    }

    function versionNumber() {

    // return version number (e.g., 4.03)

    return parseFloat(navigator.appVersion)

    }

    // show me -->

    </script>

    <BODY ONLOAD="browserSizeUp()">

    </BODY>
    </HEAD>
    </HTML>

  2. #2
    If your Server lets you use ASP use the response.redirect method to call the correct page.

    java code...
    {
    <%response.redirect http://someplace/IE.htm%>
    }

    else

    {
    <%response.redirect http://someplace/netscape.htm%>
    }


    That there should work

  3. #3
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    This code doesn't work for the version number. Please help, I really need this to work.
    seoptimizer2001
    VB 6.0, VC++, VI, ASP, JavaScript, HTML,
    Perl, XML, SQL Server 2000

    If God had intended us to drink beer, He would have given us stomachs.


    Please use the [code] and [vbcode] tags in your posts!
    If you don't know how to use them please go HERE!


  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by nmretd
    This works fine However, how can I adapt it so that it fires off a certain html page once it has determined that the browser is IE ?

    didnt u just do that?

  5. #5
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Client side javascript:
    Code:
    document.location.href = 'somepage.html';
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

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



Click Here to Expand Forum to Full Width