Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
307 views
in Technique[技术] by (71.8m points)

html - HTML5 in IE6 when JavaScript is disabled

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 >


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...