I have a JS/jQuery intensive website and certain very important functionality works on JS and Jquery (features without which the site wont function properly). I want to disallow users who have JS-disabled to use my web app. Has anyone done this before?
2 Answers
You can use the noscript tag to easily display a message to users with JavaScript disabled. Something like this:
<noscript>
You must have JavaScript enabled in your web browser to use this site.
</noscript>
You can't, however, disable the site for those users. This is because you have no way of detecting whether or not JavaScript is enabled until you've already sent the page to the client.
Note also that this is not a recommended practice in general. It's better to provide the basic functionality of the site and then use JavaScript to enhance the UX, not to require JavaScript entirely.
2 Comments
The noscript tag allows you to provide alternate content to users with javascript disabled. See http://www.w3schools.com/tags/tag_noscript.asp