Javascript Enable?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Mohit_Prog
Forum Commoner
Posts: 26
Joined: Mon Apr 23, 2007 6:10 am

Javascript Enable?

Post by Mohit_Prog »

Hi friend,

How can I check whether Client machin's Javascript is ON or OFF?

It is urgent. Please reply soon.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

I'm sure that you can. I'm not familiar with the way to do so, but what I'd do (personally) is create a cookie in JavaScript and then check if the cookie exists or not in PHP. If it doesn't then give them a different version of the website. But that's the only way I can think of for it to mesh with PHP code. If that's not what you want, I'm sure you can Google it.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

You can't. You can check if the browser has javascript capability using PHP get_browser but unless you use the html <noscript> tag to insert some hidden information (in a form for instance) you have no information as to the current browser settings such as disabled javascript.
Post Reply