Rogue said:
Agreed.... javascript is also evil.
His comment does not say that. It says that a site should be navigable
and minimally functional with pure HTML.
This means that JavaScript (Java, Flash) can be used to enhance, but not
replace, static content.
User agents with JavaScript (Java, Flash) unavailable or disabled should
get a (minimally) functional site.
User agents with JavaScript (Java, Flash) available and enabled can
receive a much richer experience.
This means that it's best to let the browser render all relevant content
initially, then hide/manipulate content using JavaScript after the page
has finished loading. This means that:
<body onload="hide();">
<script type="text/javascript">
function hide() {
if (document.getElementById) {
var d = document.getElementById('submenu');
if (d && d.style && typeof d.style == 'string') {
d.style.display = 'none';
}
}
}
</script>
<div id="menu"><!-- menu --></div>
<div id="submenu"><!-- submenu --></div>
is preferable to:
<div id="menu"><!-- menu --></div>
<div id="submenu" style="display:none;"><!-- submenu --></div>
The first example hides the submenu only after it has been determined
that the browser has the ability to hide the content (which implies, but
does guarantee, that it can make it visible again).
The second example hides the submenu in all browsers which understand
style="display:none;", which includes many browsers which have _no_ means
to undo the application of that style at a later time.