question about browser detection

Results 1 to 4 of 4

Thread: question about browser detection

  1. #1
    Ms. whatever Guest

    Default question about browser detection

    hey all, i have a small question here. i did this small ASP program for browser detection and it works for IE, but for some reason it does not work with Netscape. i am using Netscape Navigator 4.73. here is the code below. i would appreciate it if some one could help me. <BR> <BR> &#060;%@ Language=VBScript %&#062;<BR><BR>&#060;HTML&#062;<BR><BR>&#060;HEAD& #062;<BR><BR>&#060;META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"&#062;<BR><BR>&#060;/HEAD&#062;<BR><BR>&#060;BODY&#062;<BR><BR>&#060;%< BR><BR>dim BrowserType <BR><BR>set bc = Server.CreateObject("MSWC.BrowserType")<BR><BR>if bc.browser="IE" then<BR><BR> BrowserType = "MSIE"<BR> <BR>elseif bc.browser="Netscape" then<BR><BR> BrowserType = "Netscape"<BR> <BR>elseif bc.browser="Lynx" then<BR><BR> BrowserType = "Lynx"<BR> <BR>end if<BR><BR>%&#062;<BR><BR>&#060;%<BR><BR>select case BrowserType<BR><BR> case "Lynx"<BR> <BR> Response.Write("You&#039re using Lynx! How do you manage to live<BR> without 3-D backgrounds and endless download times? Whatever!")<BR> <BR> case "MSIE"<BR> <BR> Response.Write("You&#039re using Internet Explorer! Thank you for <BR> helping keep Microsoft afloat!")<BR> <BR> case "Netscape"<BR> <BR> Response.Write("You&#039re using Netscape! And you&#039re wearing those <BR> great pink pants! ASP knows everything about you!")<BR> <BR> case else<BR> <BR> Response.Write("You&#039re using some other browser I don&#039t know <BR> about.")<BR><BR>End select<BR><BR>%&#062;<BR><BR><BR><BR><BR>&#060;/BODY&#062;<BR><BR>&#060;/HTML&#062;<BR><BR><BR>thank you for your help<BR>

  2. #2
    Corin Guest

    Default RE: question about browser detection

    you need to update your browscap.ini file. I use the same script and once I updated the file it works great.

  3. #3
    Joel Nelson Guest

    Default RE: question about browser detection

    Make sure you have an the latest and greatest browscap.ini file. If you don&#039t have the necessary entries in that file to identify Navigator 4.73 then it will return the browsers name as "Default". <BR><BR><BR>HTH<BR>

  4. #4
    Corin Guest

    Default another fact

    The server you run the script on must have the updated browsercap.ini file as well

Posting Permissions

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