aFarkas / html5shiv

This script is the defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer.
http://paulirish.com/2011/the-history-of-the-html5-shiv/
9.89k stars 2.56k forks source link

README: Missing HTML example? #90

Closed mhulse closed 11 years ago

mhulse commented 11 years ago

Stoopid question, but is it still recommended to use IE conditional:

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

I've even been using:

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

I didn't see an example of this in the README, so does that mean I don't need to use the conditional comments anymore?

If I do, or if it is best practice to use IE conditional comments, which syntax is best?

Thanks! Micky

jonathantneal commented 11 years ago

html5shiv handles html5 issues in non-ie browsers, specifically in styling. Take a look.

https://github.com/aFarkas/html5shiv/blob/master/src/html5shiv.js#L215-218

mhulse commented 11 years ago

@jonathantneal Thanks for the reply/help, I really appreciate it. :)

I only asked because I've been using the html5shiv since the Google repo days:

http://code.google.com/p/html5shiv/

... as you can see, that page the example has IE conditional.

I remember reading that using the IE conditional is just a way to save on network request for browsers that already understand HTML5. I'm sure that's still the case, I just wanted to confirm my assumptions.

Thanks again for the help!

jonathantneal commented 11 years ago

You're very welcome. Thanks for asking. I'll ask @remy to update the example.

mhulse commented 11 years ago

Thanks @jonathantneal! Have a great day. :+1:

mhulse commented 11 years ago

Just a quick update, I was reading around the net, and it sounds like a certain version of Windows Phone 7 will support HTML5?

For example:

The next Windows Phone 7 update, code named Mango, will have IE Mobile 9, which contains HTML5 support. It'll be the first major update for WP7, but might not have Silverlight browser support after all. It's unclear if third-party multitasking and Twitter integration will make it.

I also found people using:

<!--[if (lt IE 9) & (!IEMobile 7)]>
<![endif]-->

... but now I'm wondering if it should be:

<!--[if (lt IE 9) & (lt IEMobile 9)]>
...
<![endif]-->

Note: I'm not sure about the & in there.

I need to do more research ... I don't have windows mobile devices, so some of this is just speculation. :dancers:

mhulse commented 11 years ago

Ahh, there appears to be no IE Mobile version 8! So this logic should suffice:

<!--[if (lt IE 9) & (!IEMobile 7)]>
...
<![endif]-->