Anees said:
I have some unavoidable javascript code in my page.
so if a user opens the page in a javacript disabled browser my page
will be completely messed up!!!!
BAD. Broken as designed.
By applying the principle of graceful degradation in the first place: don't
have the basic functionality of the document and Web site depend on enabled
client-side script support, but only provide additional features with it.
Quite obviously you can not check with scripting if script support is
present and enabled, or not; that would be like using a possibly defective
light bulb to see if there is a current on the circuit. You can only check
whether the light bulb lights up assuming that there is a current on the
circuit[1], i.e. you can do something if script support is present and
*enabled*, and you just don't do that if it isn't, e.g.
<body
onload="/* only executed with present and enabled script support */">
<a href="foo.html"
onclick="/* only executed with present and enabled script support */">
<script type="text/javascript">
// this is only executed if script-support is present and enabled
document.write('<input type="button" value="Foo" onclick="foo();">');
</script>
The HTML 4.01 Specification also defines the `noscript' element which can be
used for alternative content to be displayed in the case that client-side
script support is not available. But you should use it carefully.
Certainly do not use it for the following:
<noscript>
Your browser does not support JavaScript. ...
</noscript>
Because that is not necessarily true. Your user may have the light bulb
screwed in and it would light up if there was current on the circuit (i.e.
*present* script support would be *enabled*), but there isn't.
BTW: Your Exclamation Mark key is broken.
PointedEars
___________
[1] as all examples go, they may not fit the situation exactly