Hiding Scripts from Older Browsers - HTML

Not all browsers support JavaScript. Many of the older browsers are not JavaScript enabled, and some of the latest browsers may not support the scripting language you are using.
Note Most modern browsers will ignore scripts of types they do not recognize. If you are concerned about older browsers not recognizing your scripts, you will need to hide your scripts so that older browsers will ignore them (instead of trying to render them).
To hide your scripts, simply place them within a special set of comment tags. The only difference between normal comment tags and script-hiding tags is that the closing tag contains two slashes (//). Those two slashes enable browsers that support scripting to find the script.
For example, the following structure will effectively hide the scripts within the <script> tag:

<script type=“text/javascript”>
<!-- hide scripts from older browsers
--- Script content ---
// stop hiding scripts -->

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

HTML Topics