Informing User that JavaScript is Required on a Web Page

Mindwatering Incorporated

Author: Tripp W Black

Created: 08/17/2009 at 03:32 PM

 

Category:
Notes Developer Tips
JavaScript

Issue:
Detect if JavaScript is disabled when it's disabled. It is hard to run code to detect that code cannot be run...
You can do the reverse though...

Workaround:
Add the following as passthru HTML to display to the user that a form will not work w/o JavaScript enabled:

<p class="pstyle">
<script type="text/javascript">
document.write('JavaScript is enabled');
</script>
<noscript>
Javascript is disabled
</noscript>
</p>

previous page