Bear Bibeault wrote:Capability detection (as shown in your example), rather than browser detection, is highly preferable.
Or better yet, use a library like jQuery where someone has already done the work for you.
Ok, And for old browsers, we cannot do anything but write our javascript code in the following way.
<script type="text/javascript">
<!-- hide script from older browsers
---- Your JavaScript functions here ----
// -->
</script>
The old browsers will comment out everything between <!-- and --> ignoring the javascript commnets //. New browsers will realize that // is a javascript comment and execute the javascript code.
Correct?