Let old version IE support HTML5
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;