Hiding JS code from old browsersQuestion: How do I hide JS code from old browsers that do not support JavaScript? Answer: This question has become far less relevant now that virtually all browsers support JavaScript. Nevertheless, to prevent old browsers from displaying your JS code, you can do the following:
<script language="JavaScript"> <!-- Here you put your JS code. Old browsers will treat it as an HTML comment. //--> </script>
Old browsers will treat your JS code as one long HTML comment.
On the other hand, new JavaScript-aware browsers will
normally interpret JS code between the tags
|
Copyright © 1999-2011, JavaScripter.net.