No javascript detection message

Below is the html code that I have been using for many website to tell the visitor to enable the Javascript. Any code between the <noscript> tag will only be displayed if user’s browser doesn’t support Javascript. It will put the message fixed at the top of the website. The message will take about 3.5em, that is why I have the top margin in the <noscript> tags.

In the aspx page:
<noscript>
<style type=”text/css”>
body { margin-top:3.5em; }
</style>
<div id=”noscript-warning” style=””> This website works best with JavaScript enabled </div>
</noscript>

In the css file:
#noscript-warning {
background-color:#AE0000;
color:white;
font-family:Arial,Helvetica,sans-serif;
font-size:140%;
font-weight:bold;
left:0;
padding:10px 0;
position:fixed;
text-align:center;
top:0;
width:100%;
z-index:101;
}

Advertisements

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: