Jump to content

JavaScript Enabled/Not?


dibosite

Recommended Posts

i have javascript code in the php page , and that code must be done , i want the php to check if the javascript is enabled in the browser  or not ? , i  am not talking about if the browser support javascript or not , i need to know if the client is enabling javascript or not ?

Link to comment
Share on other sites

The only way to find out is to attempt to use some javascript. If the javascript doesn't work, then it is turned off.

 

PHP can't do this because it's server side and javascript is client side.. trust me I've tried.

 

Your best bet is to dop something such as setting a cookie using javascript, then refreshing the page. Use php to check if the cookie is set. If it's set, then javascript is enabled. If not, either javascript is disabled, or cookies are disabled.

 

Also you should never make javascript mandatory. You can usually use php or another script to replace javascript for important things.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.