How to enable IE to support HTML5 standards

Source: Internet
Author: User
Tags html header

 

Since the introduction of HTML5 standards, there has been a lot of attention, and the support of HTML5 standards by Internet Explorer, which is the most widely used in the world, is also a matter of high attention, at the Technical Conference last week, Microsoft said that the ie9 currently being developed by Microsoft will support HTML5 standards more. However, Microsoft is a bit vague about whether ie9 will fully support all HTML5 standards. HTML5 standards can bring more efficient and clean web pagesCodeOnly when Microsoft is involved in HTML5 design can the IE browser recognize more new elements.

The HTML5 standard is expected to be released to the world in 2022. Although it is about three years away from its release date, I think it is not that far away from us, currently, many websites are designed and developed based on the HTML5 standard. In terms of HTML5 standard formulation and promotion, well-known browser vendors such as Apple, Google, opera, and Mozilla are all very active, and Microsoft is now taking actions, according to the ie9 details released by Microsoft at the technical conference last week, Microsoft will adopt a cautious approach to get involved in Webpage standards. Microsoft once said: IE browser will focus on standard HTML5. However, Microsoft's latest IE 8 and earlier browsers have limited support for HTML5 tags. We can add scripts to webpages to solve the HTML5 Support Problem of IE.

To enable IE (including IE6) to support HTML5 elements, we need to add the following Javascript in the HTML header. This is a simple document. createelement declaration that uses conditional annotations to call this JS file for IE. Opera, Firefox, and other non-ie browsers will ignore this code and there will be no HTTP requests.

<! -[If IE] >
< Script SRC = "Http://html5shiv.googlecode.com/svn/trunk/html5.js" > </ Script >
<! [Endif]- >

The above code will only run in IE browser. Note that calling the html5.js file on the page must be added to the Header element of the page, because IE browser must know this element before parsing the element, this JS file cannot be called at the bottom of the page.

This HTML5 JS file is provided by the author on the Google Code project for direct calls. Of course, if you think this will affect your webpage opening speed, you can download HTML5 JS files and upload them to your server for separate calls.

The following is the code in the HTML5 JS file:

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

In addition to calling JS files containing the above Code on the webpage to allow IE to support HTML5 elements, you can add the Code directly to the webpage in the following way.

<! -[If IE] >
< Script >
( 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])}) ()
</SCRIPT>
<! [Endif]->

The IE Development Manager, Adrian Bateman, once said that the IE team wanted to share their views on HTML5 and participate in the discussion on developing this standard. Although the IE Team currently raises more questions than provides a solution, public discussion is the best way to promote HTML5 development. I believe that no matter whether IE browser can continue to support the HTML5 standard, the widespread use of the HTML5 standard in the world is the trend of the times.

 

ArticleReference address: http://www.iefans.net/ieliulanqi-zhichi-html5-fangfa/

Author: iefans

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.