Showing posts with label disabled. Show all posts
Showing posts with label disabled. Show all posts

Wednesday, 7 March 2012

JavaScript: check if it is enabled or not

   


Web developers rely heavily on JavaScript. However, a whole web site project might be jeopardised if in the end the final user's browser has JavaScript disabled. In those cases a good web developer plans good fallbacks accordingly. But, how can we check if JavaScript is enabled?

Believe me it is very simple. When I found the following solution a long time ago, I was amazed by its simplicity and effectiveness.

As a start, we need to insert a form in the body of our page. I would suggest, we put it at the very beginning of the page:
<form name="js" id="js">
  <input type="hidden" name="JSstate" value="false">
</form>