HTML 5 & Internet Explorer - Fair Warning
Most articles and weblog posts on using HTML 5 recommended Remy Sharp’s handy script to make Internet Explorer recognise HTML 5’s new tags. But few offer a solution to the problem of folk browsing an HTML5 site in IE with JavaScript turned off.
Rather than treat JS-averse IE visitors to a hideous mess of a site, I’ve decided to treat them to a hideous mess of a site plus a polite suggestion to switch JavaScript on:
<!--[if IE]>
<noscript>
<div>
<p>Are you using Internet Explorer with JavaScript turned off?</p>
<p>This site probably looks a bit of a mess.</p>
<p>If you can, turn JavaScript on, and reload the page - that
should fix the problem.</p>
<p>If you can't do that, my apologies. For fun,
I made the site using new code that Explorer doesn't
understand just yet.</p>
<p>Comments? Complaints? Email me at j@ck.mottr.am</p>
</div>
</noscript>
<![endif]-->
Since I’m already serving all versions of IE a special stylesheet, I’ve added a bit of CSS to make <noscript> look all warningy:
noscript div {
margin:60px;
padding:10px;
color:#ff0000;
background:#ffffe0;
border:1px solid #ff0000;
}
I wonder if it’s worth adding instructions on how to switch JavaScript on?
Update: The apparently extraneous div inside the noscript is included to fix a bug in IE8.
You can tweet a reply using a link to this page or the hashtag #mot_ie5. (Help?)
Commenting via Twitter
If you have a Twitter account and wish to reply to this post, just tweet what you'd like to say, and make sure to put #mot_ie5 somewhere in your tweet.
The gobbledygook beginning with '#' is called a 'hashtag', and makes it easy for this site to search Twitter for your tweet, and display it on the correct page.
Alternatively, you can tweet about this post and include its short URL, http://mottr.am/ie5, and your tweet will be displayed automatically, whether you use the hashtag or not.
If you don't have a Twitter account, and would rather not use the comment form, feel free to send me an email instead: j@ck.mottr.am