Tuesday, April 1, 2008

Warn when javascript is disabled

Though there are many ways to determine whether users browser disabled javascript or not, I'm used to go with the simple solution of using <noscript> tag to get the purpose done. It works for all my apps and most popular browsers; and I'm fine with that.

In my master page, I simply add this section as first thing in the body:

<noscript>

<div style="background-color: BlanchedAlmond; border-bottom: 1px solid #E4D199; padding: 10px;

font-size: 10px;" align="center">

Your browser settings are limiting the site functionality. Please enable scripting to get the site's full functionality.

</div>

</noscript>

Love coding!

No comments: