Let old version IE support HTML5

time:15-10-03 forum:HTML web page, JS language and code
  http://www.cnblogs.com/mcad/p/4825717.html

has always wanted to start with C3 and H5, but because the projects developed have been required to be compatible. These two browsers do not support HTML5, so they have been watching but not really investing too much energy to learn. Although I know H5 and C3 are the mainstream. In recent project development, a chance chance let me know two JS plug-ins. And these two components just solve my trouble. There is a good saying: "everything is ready, only owes to the east wind!" Say so much, then formally talk about the east wind.
html5shiv.js and respond.js. These two JS files enable IE browsers that do not support H5 to start accepting H5 and C3 support.
1.html5shiv.js
html5shiv.js allows browsers that do not support HTML5 to support HTML5 tags. New elements of HTML5 cannot be wrapped as parent elements, and CSS styles can not be applied. The use of html5shiv is very simple. In view of IE9's support for HTML5, direct election should add the following code in the head of the page.

[code].lt;! --.#91; ifltIE9.#93;.Gt;
.lt; script type=.quot; text/javascript.quot; src=.quot; And use a well defined style.
2.Respond.js

Respond.js is a fast, lightweight Polyfill (annotation 1) that provides a min-width and max-width feature for a media query for IE6-8 and other browsers that do not support CSS3 Media Queries to implement a responsive Web Design (Responsive).
annotation 1: what is shim? What is Polyfill?
shim: a library that introduces a new API into an old environment and implements
polyfill by means of existing means in the old environment: it is a shim. that is used on the browser API, and our usual practice is to check whether the current browser supports a API if it does not support the shim.. The polyfill. and the old and new browsers can use this API. The term Polyfill comes from a home decoration product Polyfilla.

it is also very convenient to use!
[code].lt;! --.#91; ifltIE9.#93;.Gt;
.lt; script type=.quot; text/javascript.quot; src=.quot; scripts/respond.js.quot;

prev:Nanjing university students' self-develo... next:The tenth Ji'nan Shandong culture and Ar...
post comment
Notice



approved   People in Shandong have gone through...   The teacher was red for the student'...   Sichuan leg free man wrote thousands...   The domain name stolen and retrieved...   "Silly" old lady Ding Ruiyun: promis...
rand   Interesting JS background animation ...   The parent window refreshes the chil...   CSS tutorial: a detailed explanation...   The difference between href=# and hr...   HTML5-JS file - let IE browsers supp...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com