Code Problems

Results 1 to 2 of 2

Thread: Code Problems

  1. #1
    Join Date
    Dec 1969

    Default Code Problems

    I have the following piece of code:<BR><BR>&#060;select onChange="MM_jumpMenu(&#039parent&#039,this,0)" &#060;% if isIE then %&#062; STYLE="LANGUAGE=JavaScript;background-color:#9c998e;font-family:arial;font-size:9pt;color:#ffffff" &#060;% end if %&#062; name="menu"&#062;<BR><BR>What i am trying to do with this code is to check if the browser that is being used is Internet Explorer and if it is then to execute the STYLE= but if its not IE then to exclude the STYLE= when i run the page both in IE or Netscape the STYLE= does not get executed, am i using the right code to check which browser is being used.<BR>Thank you<BR>

  2. #2
    Ed Auth Guest

    Default This is how to use ASP to determine the browser

    Place the following code before the select box:<BR><BR>&#060;%<BR>&nbsp;Set bc = Server.CreateObject("MSWC.BrowserType") <BR>&nbsp;If bc.browser = "IE" Then<BR>&nbsp;&nbsp;isIE = True <BR>&nbsp;Else<BR>&nbsp;&nbsp;isIE = False <BR>&nbsp;End If<BR>&nbsp;bc.Close<BR>&nbsp;Set bc = Nothing <BR>%&#062;<BR><BR>-- Ed Auth

Posting Permissions

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