Detecting JavaScript

N

Nick Goloborodko

Hi,

What is the best way to detect JavaScript and Cookie support of the end user
browser?

TIA
 
K

Ken Dopierala Jr.

Hi Nick,

You can put a <noscript></noscript> tag on your page. Whatever HTML you put
between the tags will be shown in any browser that doesn't support
Javascript or Javascript is disabled. I'm not sure if there is a property
on the server-side that you can check for. If anything you could increment
a hidden input that has runat="server" set with Javascript. When a postback
occurs you can check that variable. If it hasn't incremented or been set to
a value via the Javascript then you'll know that it isn't supported.

I've never tried this but maybe you can even put that hidden field in the
<noscript> block and then check for it when you get back to the server, if
it is present then you'll also know that Javascript is enabled and you won't
need to screw around with programatically setting anything. Good luck!
Ken.
 
K

Ken Dopierala Jr.

Hi Peter,

That will tell you if a browser has Javascript support but it won't tell you
whether it is disabled or not. Ken.
 
N

Nick Goloborodko

Hi,

I was thinking of doing a post back using JavaScript on the first request,
however that just seems clumsy. I do appreciate your help thou :)

If anyone else has some input they can make on this topic it will be greatly
appreciated :)
 
J

Juan T. Llibre

Sending a cookie and testing for its existence,
and writing a Javascript which sets a variable
and testing to see if the variable exists.

There's no way to do it, but by doing it.
 
S

Steven Cheng[MSFT]

Hi Nick,

I think Juan and Ken's suggestions are reasonable. If we do need to get
whether the client user has manually disabled the cookie or script, we have
to add some addional roundtrip to clientside to detect the settings.

Thanks,


Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top