From this previous question I found that the code below can determine if a user has IE, and then run js-code specific to them. But when I used the code on my site, the effect was the opposite. On other browsers the code is fired, on IE not.
What am I doing wrong?
<![if !IE]>
<script type="text/javascript">
$(document).ready(function() {
$(".box.2").fadeOut(1500);
});
</script>
<![endif]>
Remove the
!in front ofIE– it reverses the sense of the test and means don’t do this on IE!To ensure that other browsers ignore the text, write the comment thus:
NB: Microsoft have dropped support for conditional comments when using IE 10 in full HTML5 mode.