문제

This snippet shows (replacement) content for users without Javascript, similar to the <noscript> tag.

<SCRIPT> document.write('<style type="text/css">#no_js{display:none;}</style>'); </SCRIPT>
<TAG id="no_js"> Content for users without Javascript </TAG>
<SCRIPT> var x=document.getElementById("no_js");x.parentNode.removeChild(x); </SCRIPT>
  • Line 1 hides the Content of line 2 with CSS.
  • Line 3 additionally removes the content - for Browsers without CSS but with Javascript.

I wonder whether line 3 is academic and can be left out.

Are there real world users around with no CSS but Javascript ?

Related posts:

Why not noscript tag

Avoid flickering

올바른 솔루션이 없습니다

다른 팁

There's no reason to assume anyone would intentionally disabled CSS for normal browsing. Historically, there were reasons people would have javascript disabled, such as security or performance, but that shouldn't be a concern with CSS. If there's a device using your site that doesn't have CSS, you certainly shouldn't plan on it using javascript.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top