Possible Duplicate:
How to detect if JavaScript is disabled?
I'm curious what other people would see as most viable for catching if a user has JavaScript disabled. Here's 2 types of methodology I'm thinking of using; if someone has a better idea or any ideas or things I should watch out for while putting either of these together please let me know.
First method
- pass a variable to PHP with a JavaScript function.
- depending on variable PHP either writes the JavaScript or non-JavaScript version.
Second method
- pass a variable to PHP with a JavaScript function.
- depending on variable PHP redirects using header to the JavaScript powered or non-JavaScript powered sites.
I'm guessing the first would be best seeing as the user wouldn't be redirected out of the page; however I'm curious is there an easier way to detect if JavaScript is disabled or enabled? Can I do that with a PHP function instead of using JavaScript. Using the above method would just assume that if they have JavaScript disabled the variable wouldn't be passed and the PHP would output the non-JavaScript version of the site.
Any takes?