4

My site uses an HTML5shiv for the benefit of Internet Explorer 6 users. What will happen if they have JavaScript disabled?

Will the CSS for my fancy new elements (video, article etc) still work?

6
  • 2
    No, it won't because HTML5shiv depends on javascript to work. It does not degrade gracefully. Commented Oct 1, 2010 at 23:35
  • thanks @andrew, from the answers below, I think it's time to start insisting that users have JS enabled Commented Oct 1, 2010 at 23:58
  • 1
    I'd still recommend graceful degradation. Unless you're willing to lose potential visitors, then it's probably best to wait until HTML5 is at least a W3C recommendation before implementing features from the bleeding edge of web development :p Commented Oct 2, 2010 at 0:08
  • You get nothing tangible from <article> or <section>. Why bother? Commented Oct 2, 2010 at 0:13
  • 3
    Waiting for a "recommendation" really gives you nothing more than you already have now. IE6-8 won't start working with disabled JavaScript even then. You just have to consider how many potential users of your site will actually use IE with disabled JavaScript. Generally it's a rare combination (users with disabled JavaScript tend to be geeks, and geeks don't use IE). Commented Oct 2, 2010 at 11:26

3 Answers 3

5

This is dependent on your site and how much it relies on HTML5 elements. The easiest way to find out is to simply run your site on IE6-IE8 with JavaScript disabled and see!

With that said, you can expect your elements to mostly just not show up with styles. IE6-IE8 do not understand HTML5 elements and won't apply CSS to them if it doesn't expect them. The HTML5 Shiv is used to force IE to understand the new elements and then it automatically applies CSS to those elements.

Ultimately I think JavaScript being disabled is pretty rare now. Back in the day it was disabled to avoid annoying and useless flashy effects. Some people still do it, but so many sites require interactive behavior (the very site we are on now is heavily reliant upon JS) that users disabling JS are probably used to shit being broken across most of the internet.

It is not an unreasonable requirement that users have JS enabled, especially on such an old browser. If you design for the lowest common denominator you'll either end up supporting multiple code paths which takes a lot longer, or end up with an uninspiring website. Sometimes (government, school, large corporate websites) you need to do this, but for most of the web it's probably not going to kill you to simply have a JS Required message show up if the user does not have it on.

(MINUS SPACES) < noscript >code here gets executed when javascript is diabled< /noscript >

Sign up to request clarification or add additional context in comments.

6 Comments

and I like the idea of having a JS-required message
Couldn't disagree more. Requiring Javascript, when it's not actually essential to functionality, is a Giant Leap Backwards. Welcome to 2002. Yes, only a small proportion of the overall browsing population have JS off... but that small proportion includes search engines, and somewhere between 10% and 25% of screenreader (JAWS etc) users. I'm all for using html5 elements, but if that puts up a total roadblock to some people using the site, walk away.
... having said that, we are of course only talking about CSS styling here. The content within html5 elements will still be displayed/browseable - just not styled via the html5 elements themselves.
mattandrews: The HTML5 shiv requires javascript on older browsers to function. You can go ahead and disagree until your face turns blue, but any site making use of new HTML5 elements will simply not work in older browsers without javascript. So the options then become: a) re-code the entire website in an older version of HTML or XHTML and offer that version to people running old browsers. or b) require javascript. I would go so far as to say the people living in 2002 are those who are afraid to rely upon now common and useful features available with modern web programming techniques.
Wrapping HTML 5 elements in divs is an incredibly poor solution, you may as well not even bother with "HTML5" if you're doing something so daily wtf worthy for the sake of old browsers anyway. You've completely missed the point of the new standard in my opinion.
|
4

Styling HTML 5 elements would be useless without Javascript in IE6 as it's necessary to document.createElement them. If you really need to support noJS IE6 users, don't use HTML5 elements or have backup div elements that do the same thing.

Comments

1

Who really disables JavaScript these days? If they do, yes, there is no doubt that everything will break.

Also, it's not just for IE6. No version of IE before IE9 supports automatic styling for unknown elements. (Reference: A long digression into how browsers handle unknown elements)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.