I agree with what Twey has said, at least as I understand it, and don't think he was being mean about it, rather quite generous in his explanation. And, though it may appear to be an opinion, and may be to an extent, it is basically just the facts of the matter. To the extent that it is an opinion, it is one supported by those facts. Trinithis' idea is the standard approach if one still insists upon doing such a thing:
HTML Code:
<noscript><p>Your message to non-javascript enabled browsers here</p></noscript>
This can be 'enhanced' (in reality degraded) by a combination of javascript and css, such that no content other than the non-script content be rendered for non-javascript browsers. Remember, as Twey says, many of these users cannot turn on javascript. Something I think he left out is that some of them wouldn't benefit from having javascript, even if they could. These include blind users with screen readers, probably others.
Now, if you still want to go all the way with this highly questionable concept, you can organize your body section like so:
HTML Code:
<body>
<div><noscript><p>Your message to non-javascript enabled browsers here</p></noscript></div>
<div id="content">
The actual content of your page goes here
</div>
</body>
Use this style followed by the script shown, put both in or (preferably) link both to the head section of your page, the order is important:
Code:
<style type="text/css">
#content {
display: none;
}
</style>
<script type="text/javascript">
document.write('<style type="text/css">#content {display: block;}<\/style>');
</script>
Bookmarks