dibosite Posted October 31, 2007 Share Posted October 31, 2007 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 https://forums.phpfreaks.com/topic/75429-javascript-enablednot/ Share on other sites More sharing options...
Dragen Posted October 31, 2007 Share Posted October 31, 2007 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 https://forums.phpfreaks.com/topic/75429-javascript-enablednot/#findComment-381578 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.