vijay Posted March 19, 2007 Share Posted March 19, 2007 Hi.. How can we check whether javascript is enabled or decabled with the help of any server script or any other way.. ? (except changing IE/Firefox 's settings from internet option) Thanks in advance...!Regards,Vijay Link to comment Share on other sites More sharing options...
justsomeguy Posted March 19, 2007 Share Posted March 19, 2007 PHP cannot detect the presence of Javascript. You would need to use AJAX or something like that to send a request to the server, if the request comes in then Javascript works! Link to comment Share on other sites More sharing options...
jesh Posted March 20, 2007 Share Posted March 20, 2007 PHP cannot detect the presence of Javascript. You would need to use AJAX or something like that to send a request to the server, if the request comes in then Javascript works!Didn't you (justsomeguy) have an example of something like this on one of these posts a week or two ago. Adapted from that, the javascript tester could look something like this:<script type="text/javascript">var test = new Image();test.src = "jsEnabled.php";</script> If jsEnabled.php is requested, then javascript is enabled. Link to comment Share on other sites More sharing options...
iyeru42 Posted March 20, 2007 Share Posted March 20, 2007 That won't work if you have javaScript disabled with such a thing as NoScript for Firefox (Which would also make sure that AJAX wouldn't run.) Link to comment Share on other sites More sharing options...
justsomeguy Posted March 20, 2007 Share Posted March 20, 2007 Yes iyeru, that's exactly the point. If it doesn't run, then you know that Javascript is disabled or not supported. If it runs, then you know that it is. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now