Possible Duplicate:
Best way to detect that HTML5 <canvas> is not supported
Now that $.browser is being taken out of jQuery in favor of $.support, how would I detect IE8 with jQuery, or with plain javascript?
if ($.browser.msie && parseInt($.browser.version, 10) === 8) {
alert('IE8');
}
Sorry, but HTML will not work for me. So I can not do this:
<!--[if IE 8]>
<script type="text/javascript">
ie = 8;
</script>
<![endif]-->
Specifically, I am looking to do work with the canvas tag and IE8 does not support canvas, but jQuery.support does not detect for canvas support.
Test for the feature instead:
Edit:
As in the link suggested in comments by Brandon Boone, here’s a function that does it: