Integrating JS with ASP

Results 1 to 2 of 2

Thread: Integrating JS with ASP

  1. #1
    Tim H Guest

    Default Integrating JS with ASP

    Do you know how to integrate JavaScript with ASP? For Example:<BR><BR>&#060;SCRIPT RUNAT=server LANGUAGE=javascript&#062;<BR>&#060;!--<BR>if(navigator.appName == "Netscape") <BR> {<BR> &#060;%strMailtosep = ","%&#062;<BR> }<BR>else <BR> {<BR> &#060;%strMailtosep = ";"%&#062; <BR> }<BR>//--&#062;<BR>&#060;/SCRIPT&#062;<BR><BR>When this code is run, "strMailsep" always equal to a semicolon; even when I use a Netscape browser.

  2. #2
    Join Date
    Dec 1969

    Default RE: Integrating JS with ASP

    You&#039re indicating to Javascript to run at server so, there is no clientside script to detect the browser. Try this or something similar:<BR><BR>&#060;%var lnBrowser = new String(Request.Servervariables("HTTP_USER_AGENT")) ;<BR> if ("Netscape") &#062; 0)<BR> {<BR> strMailtosep = "," ; //Do Netscape stuff<BR> }<BR> else<BR> {<BR> strMailtosep = ";" ; //Do non-Netscape stuff<BR> }<BR>%&#062;<BR><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