View Full Version : Checking if javascript is enabled

10-04-2010, 02:39 PM
Hi all.

This is a generic question as Google didn't help at all, does anyone know how to check if javascript is enabled and then I want to display info based on that.

I don't mind how I do it, HTML, PHP or whatever

Regards, Magnetica

10-04-2010, 02:45 PM
you check it the other way round. you display the info by default and use JavaScript to remove it (which it won’t do if it’s disabled)

Philip M
10-04-2010, 05:33 PM
See also <noscript> tags.

10-05-2010, 01:23 AM
you should also put your script in html comments tags

10-05-2010, 08:34 AM
you should also put your script in html comments tags
you shouldn’t. modern browsers know, what to display and what is a script or a style (that fix was required for, er, IE3, I think)

Old Pedant
10-05-2010, 08:45 AM
Well, now, you never know! He might be operating a time machine and is worried about what happens when he gets transported to 1997 or so.

10-05-2010, 08:49 AM
then he should worry about a valid passport (not one that says "valid from 2008 to 2018", otherwise IE3 will be his least problem)

Old Pedant
10-05-2010, 08:21 PM
LOL! Well, to be fair, so few people in the USA have passports that if he sounds like he's an American he'd never be asked for one inside the country. Especially in 1997.