Help me convert this ASP to Jscript??

Results 1 to 3 of 3

Thread: Help me convert this ASP to Jscript??

  1. #1
    Join Date
    Dec 1969

    Default Help me convert this ASP to Jscript??

    I have a little problem. Our web page does a browser check, and, depending upon what type of browser the user has, one of two menus are displayed.<BR><BR>We have added a thrid party bulletin board to our web site. And, in order to incorperate the other portions of our web site into this BB, I have to convert some of my ASP code to Jscript, and I have no idea how.<BR><BR>Here is my ASP code:<BR><BR>If Instr(strBrowser, "MSIE 5") or Instr(strBrowser, "Mozilla/5") Then<BR> bolActiveMenu= True<BR>End if<BR><BR>What I need to do, however, is change that to a Jscript If Then Else statement. Not only that, but, I have to use the Jscript equivelent of Reponse.Write to write out the HTML and such used by these menus.<BR><BR>So, rather than just setting a variable, I have to do something like.<BR><BR>In JScript:<BR><BR>If Browser is this type Then<BR>Do all the code for the menu<BR>Else<BR>Do the alternative code<BR>End If<BR><BR>Any suggestions??<BR><BR>Thank you all.

  2. #2
    Steve Cimino Guest

    Default RE: Help me convert this ASP to Jscript??

    Your best bet is to start by looking at the JScript reference on the toolbar on your left. It will give you examples of if then else statements in JScript.<BR><BR>Response.write is an ASP sub. It is language independent of either VBScript or JavaScript.

  3. #3
    zig Guest

    Default RE: Help me convert this ASP to Jscript??

    try this ...<BR><BR>if (navigator.appName.indexOf("Microsoft") != -1)<BR>//appName returns info regd. browser name. <BR>//your code for IE<BR>else if (navigator.appName.indexOf("Netscape") != -1)<BR>//your code for Netcapse navigator<BR><BR>does that help ??<BR>

Posting Permissions

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