HTML5 enabling script
Since HTML5 is getting more attention by way of marking up our new pages, and the only way to get IE to acknowledge the new elements, such as <article>, is to use the HTML5 shiv, I've quickly put together a mini script that enables all the new elements.
Usage & Download
The html5.js and must be inserted in the head element (this is because IE needs to know about the element before it comes to render them - so it can't sit in the footer of the page, i.e. below the elements in question).
It's conditional within the code, so Firefox et al won't run the code - but it doesn't hurt to wrap it in an IE conditional call to reduce the http pulls for other browsers:
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
I've also minified the file, so it's a matter of bytes to download.
You should follow me on Twitter here I'll tweet about JavaScript, HTML 5 and other such gems (amongst usual tweet-splurges)
Introducing HTML5
Thanks for an excellent script. I've tried it with Mads Kjaer's HTML5/CSS3 example from here
http://net.tutsplus.com/tutorials/html-css-techniques/html-5-and-css-3-the-techniques-youll-soon-be-using/
A couple of items of feedback:
1) Is CSS3 "z-index" usable? It seems to be ignored.
2) CSS3 "section" works well, is it possible to use "aside"?
Thanks!
[if IE lt 9] ?
Well I suppose we should wait on that until IE9 final is out. But at some point...
Thanks for this handy script. I should now make my hands dirty with HTML5 and IE
You seem to have a duplicate project under a similar name ?
Whats the difference between html5shim and html5shiv ?
I've tested the HTML5 in IE9 (preview till now) and it worked sooo great, that will be such a relief to us, developers, if IE9 comes out and Microsoft make an effort to "lt IE9" users change and update, maybe providing some example pages and some free stuff...
Wow, I am currently in the process of compleatly recoding my site in HTML5 and this is going to save my skin a few times I beleive. I am aiming for an almost no image site so it is pure un-adulterated HTML5. Bless its little markup.
If I understand the purpose of this code correctly, it shouldn't be needed with IE9. IE9 supports the concept of generic elements, which are elements that IE that doesn't recognise but renders (and applies CSS too) anyway.
If it does anymore than John Resig describes in the attached post, it may still be necessary for IE9 and above.
This is an excellent script that has allowed me to start writing semantic mark-up, very grateful.
Rich
I was wondering if the code is already designed to ignore/'be ignored by' IE9? If not how would I set it up so that IE9 and above ignores it?