Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can someone help me understand how this works #197

Open
bryanwillis opened this issue Jan 12, 2016 · 2 comments
Open

Can someone help me understand how this works #197

bryanwillis opened this issue Jan 12, 2016 · 2 comments

Comments

@bryanwillis
Copy link

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:

<!--[if lt IE 9]>
    <script src="bower_components/html5shiv/dist/html5shiv.js"></script>
<![endif]-->

To support IE 9 shouldn't this be something like ...

<!--[if lte IE 9]>
    <script src="bower_components/html5shiv/dist/html5shiv.js"></script>
<![endif]-->

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...

@bryanwillis
Copy link
Author

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]-->

@boorge
Copy link

boorge commented Oct 16, 2023

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]-->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants