Solutions to HTML5 support for IE

Source: Internet
Author: User

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]) }}) ()

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.