Yes, I’m aware that this question has already been post, but … I’m looking for a way to check if the Client has Javascript Enabled.
Here is my idea : At every loading page, PHP initialize $_SESSION['is_js'] to 0. Then, I wish AJAX to (via launching a script php ?) try to set $_SESSION['is_js'] to 1. If JS is enabled, AJAX will succeed, if not, the value remains 0.
I can’t use jQuery or others libraries… I have to write this in pure AJAX (I mean not using framework or librairies), and I have no idea how to do this.
Edit : I can’t use cookie. I don’t want to use <noscript>.
First you need to learn to do a ajax call in pure javascript, some website like w3schools or others
And in the php files that the ajax call , you can set the session variable to 1.
But there’s maybe better way to find if the client have javascript enable.
EDIT: I suggest to check if your session variable is , if not, try the ajax call and set the variable at 0 . If at page loading the variable is set and equal, that means the client doesn’t have javascript/xmlhttprequest enable.
And for a session, a cookie is store on the client side. So if the client refuse to store any cookie, you will never haver information in your session variables.