Re: Javascript to VBScript variables
by "Andre Crane" <andre(at)terracrane.com>
|
Date: |
Thu, 29 Nov 2001 15:55:51 -0500 |
To: |
"Shull, Conrad" <cshull(at)shscares.org>, <hwg-languages(at)hwg.org> |
References: |
ntmail1 |
|
todo: View
Thread,
Original
|
|
To get the end result that you are looking for, you will have to find out
which browser the user is using via the server variables collection in ASP.
The following code tests whether the user is using any flavor of Internet
Explorer:
----------------------------
<.%
Dim strBrowser, strVar
strBrowser = Request.ServerVariables("HTTP_USER_AGENT")
strVar = Instr(strBrowser, "MSIE")
If strVar > 0 Then
' this is internet explorer so do these statements
Else
' this is not internet explorer so do these statements instead
End If
%>
----------------------------
If you have control of the IIS server, then I would instead use the browscap
component that comes with IIS. If you are using the browscap component
however, I suggest finding a more complete version of the browscap.ini file
that comes with the Windows installation. Juan Libre has a great one, and so
does cyscape.com, if they still give it out.
Andre
----- Original Message -----
From: "Shull, Conrad" <cshull(at)shscares.org>
To: <hwg-languages(at)hwg.org>
Sent: Thursday, November 29, 2001 1:17 PM
Subject: Javascript to VBScript variables
> Old hat question, but I can't find the answer in the archives: How do I
> pass a javascript variable to vbscript? Not knowing how to do this, I've
> resorted to the best workaround I can figure out. Specifically, I need
to
> do some browser name and version detection with javascript, then use that
> info to determine what gets written in the body of the page via ASP and
> vbscript. I've tried setting cookies in javascript, then picking up the
> cookies in vbscript. This works, sort of. The problem is that the
cookies
> don't seem to be available to vbscript unless I refresh. Does this have
to
> do with execution order? I realize this is really three questions, but I
> sure could use some help with this.
>
> - Conrad Shull
>
>
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA