Sunday, 8 July 2012

Hide Scripts from Older Browsers


Hide Scripts from Older Browsers





Athough most (if not all) browsers these days support scripts, some older browsers don't. If a

 browser doesn't support JavaScript, instead of running your script, it would display the code to 

the user. To prevent this from happening, you can simply place HTML comments around the 

script. Older browsers will ignore the script, while newer browsers will run it.

HTML Code:

<script type="text/javascript">
   <-- Hide from older browsers 
    alert(" script. I ran first!")
    Unhide -->
</script>

No comments:

Post a Comment

Physics basic inventions and inventors

1.Which instrument is used to measure altitudes in aircraft's ? Audiometer Ammeter Altimeter Anemometer Explanation : ...