Kenton de Jong
Kenton de Jong

Reputation: 995

Fall Back For HTML 5 in IE 8 if JavaScript Disabled

I have recently began using HTML 5 instead of XHTML and I see many benefits. It's cleaner, simpler and easier to use. The tags are nicer, the elements make more sense, it's just a nicer and easier way to code.

However, there's the fallback that is isn't supported in IE 8 and down. To make it work, you have to use an HTML 5 JavScript shiv. This works great unless the user has their JavaScript turned off.

Doing some very crude math here, if about 13% of all users use IE 8 and down (as of November 14, 2012) and 2% of all users have their JavaScript disabled, then 0.26% of users use a legacy browser that has their JavaScript turned off. This will then cause the HTML 5 website to break. The principal of Progressive Enhancement says a website should still work with JS disabled, however in this case the website won't work at all — it will break and become a garbled mess.

A noscript tag that says "Please turn on your JavaScript." could work, but unless you can make it very obvious, it may not be seen in the mess of text and content.

Since a noscript tag in the head is valid in HTML 5, would the following be a correct way to address this problem?

 <!DOCTYPE HTML>
 <html>
 <head>
     <noscript>
         <!--[if lte IE 8]>
             <meta http-equiv="refresh" content="0"; ,URL=http://www.example.com/no-js">
         <![endif]-->
     <noscript>
 </head>

To summarize the above code, the code checks if the user has their JavaScript disabled, then checks if it's IE 8 and down and if so, then redirects to another page.

The redirected page can be made in XHTML and explain that the website is made in HTML 5 and needs JavaScript enabled in older browsers to run correctly. Then, once the user enables their JavaScript you can use something like this in the head:

<script>
    window.history.back();
</script>

So the user will automatically be resent back to the previous page.

Would this be the right way to go about this? Or is it even worth it for only 0.26% of all users?

Upvotes: 2

Views: 1640

Answers (1)

Spudley
Spudley

Reputation: 168705

To be honest, I think your last line sums it up - its not worth the effort. We all dropped support for IE6 and IE7 while they were still at higher percentages than that.

If you're really worried about that fraction of a percent, just don't use the HTML5 tags -- it's not as if they're adding any functionality to the site; they're just there for semantics.

If OldIE users with Javscript disabled are that important to you, you can live without the HTML5 tags.

Upvotes: 4

Related Questions