Open bryanwillis opened 8 years ago
Logically seems this would be the best way to include it so it works for IE9 and wont render in IE5:
<!--[if !(IE 5)]>
<script src="bower_components/html5shiv/dist/html5shiv.js"></script>
<![endif]-->
Your proposed conditional comment <!--[if !(IE 5)]> is not a valid syntax for conditional comments in Internet Explorer. Conditional comments use specific syntax that includes checks for versions, not boolean conditions like "!(IE 5)".
If your goal is to include the HTML5 Shiv for IE9 and above while avoiding rendering for IE5, you can use the following conditional comment:
<!--[if gte IE 9]>
<script src="bower_components/html5shiv/dist/html5shiv.js"></script>
<![endif]-->
I've been using html5shiv for years now. I have a mac so I've never actually seen what it does beside a browserstack test I did a year or so back.
I guess what I'm confused is how this is supporting IE9, Safari 4, And FF 3. My best guess on Safari 4 and FF 3 is that they recognize IE conditional comments somehow. But this still doesn't explain that how this supports IE9.
Usage / documentation has always been suggested implementing like this:
To support IE 9 shouldn't this be something like ...
Personally I use either css reset / bootstrap / html5 boilerplate on all my sites so the IE9 styling doesn't affect me one way or the other I'm just curious / confused on what I'm missing here...