Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asptoday_discuss thread: Detecting javascript on user's browser


Message #1 by "Trish Donnell" <trish@a...> on Mon, 4 Nov 2002 22:36:41
I tried the following to see if javascript was enabled on the user's 
browser (got this code from a book):

dim thisBrowser
set thisBrowser = Server.CreateObject("MSWC.BrowserType")
Response.Write thisbrowser.javascript

it's only supposed to return "unknown" if js is disabled, but it's 
returning it even when it's enabled.  also, i wasn't sure if "MSWC" was 
correct (that was in the book), so i tried changing that, and got an error 
that the server.createobject failed.

i'm not that familiar with "server.createobject" so any help would be 
greatly appreciated.

thanks.
Message #2 by "Paul Stonehocker" <pauls@g...> on Mon, 4 Nov 2002 15:12:11 -0800
I tried your script and it returned "true" in my IE6 browser. I saved
the file with an .asp extension and opened it using PWS (personal web
server).

Does this help?

Paul

-----Original Message-----
From: Trish Donnell [mailto:trish@a...] 
Sent: Monday, November 04, 2002 10:37 PM
To: ASPToday Discuss
Subject: [asptoday_discuss] Detecting javascript on user's browser


I tried the following to see if javascript was enabled on the user's 
browser (got this code from a book):

dim thisBrowser
set thisBrowser = Server.CreateObject("MSWC.BrowserType")
Response.Write thisbrowser.javascript

it's only supposed to return "unknown" if js is disabled, but it's 
returning it even when it's enabled.  also, i wasn't sure if "MSWC" was 
correct (that was in the book), so i tried changing that, and got an
error 
that the server.createobject failed.

i'm not that familiar with "server.createobject" so any help would be 
greatly appreciated.

thanks.

Message #3 by "=?iso-8859-1?q?Laeg=20Ent.?=" <laeg_enterprises@y...> on Tue, 5 Nov 2002 09:49:17 +0000 (GMT)
Try find the latest version of Browscap.ini on the web
and install it. That might be the issue.

 --- Trish Donnell <trish@a...> wrote: > I
tried the following to see if javascript was
> enabled on the user's 
> browser (got this code from a book):
> 
> dim thisBrowser
> set thisBrowser 
> Server.CreateObject("MSWC.BrowserType")
> Response.Write thisbrowser.javascript
> 
> it's only supposed to return "unknown" if js is
> disabled, but it's 
> returning it even when it's enabled.  also, i wasn't
> sure if "MSWC" was 
> correct (that was in the book), so i tried changing
> that, and got an error 
> that the server.createobject failed.
> 
> i'm not that familiar with "server.createobject" so
> any help would be 
> greatly appreciated.
> 
> thanks. 

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

  Return to Index