Page 1 of 1
Detect if javascript enabled
Posted: Fri Jun 25, 2004 2:09 pm
by anjanesh
Hi
Is there any way to detect if javascript enabled ? Is this possible in PHP ? $_SERVER gives the server info but how about the client's ? (equivalent of $_CLIENT ?)
Thanks
Posted: Fri Jun 25, 2004 2:13 pm
by feyd
Code: Select all
<script language="Javascript">document.write('<img src="imagescript.php?javascript=yes" />');</script><noscript><img src="imagescript.php?javascript=no" /></noscript>
Posted: Fri Jun 25, 2004 2:39 pm
by anjanesh
This is good enough. I just thought there was some constant in one of the suerglobals but I guess not.
Posted: Fri Jun 25, 2004 2:46 pm
by feyd
there's data returned by [php_man]get_browser[/php_man] that will tell you if the user agent string suggests a browser that supports javascript, but it can't identify if the browser has the feature turned on..
Posted: Fri Jun 25, 2004 3:20 pm
by anjanesh
[SOLVED]
Ok. Thanks.
[SOLVED]