Comments: Let all IE support HTML5 solutions. HTML5 has attracted more attention since it can bring more efficient and clean code to our new web pages. However, the only way for IE to identify those new elements (such as <article>) is to use HTML5 shiv, thanks to remy sharp for providing us with this mini script to solve the problem that IE supports HTML5.
Use and download
Html5.js must be called within the page head element (because IE must know this element before parsing the element, this js file cannot be called at the bottom of the page .)
The author has put js files on the Google code project and allowed them to be called directly. Of course, the premise is that you do not care about calling additional files.
Http://html5shiv.googlecode.com/svn/trunk/html5.js
You can use IE condition annotations to call this js file, so that non-IE browsers such as FireFox will ignore this code and there will be no unnecessary http requests. The following code will only run in IE:
The Code is as follows:
<! -- [If IE]>
<Script src = "http://html5shiv.googlecode.com/svn/trunk/html5.js"> </script>
<! [Endif] -->
Of course, if you do not like to call an Internet file, you can download it and upload it to your server for separate calling (allowed by the author ).
The following is the code in the js file:
The Code is as follows:
(Function () {if (! /* @ Cc_on! @ */0) return; var e = "abbr, article, aside, audio, canvas, datalist, details, dialog, eventsource, figure, footer, header, hgroup, mark, menu, meter, nav, output, progress, section, time, video ". split (','), I = e. length; while (I --) {document. createElement (e [I]) }}) ()