Enable earlier versions of IE to support HTML5 and later versions of IEHTML5
I always wanted to start C3 and H5, but because the projects I developed have always required to be compatible with IE7 and IE8. These two Browsers Do not support html5, so they have been watching and did not really invest too much energy to learn. Although I know that h5 and c3 are mainstream. In recent project development, I had a chance to learn about two js plug-ins. These two components solve my problem. There is a good saying: "Everything is ready, but it is not enough !". After talking about this, let's talk about Dongfeng.
Html5shiv. js and respond. js. These two JS files enable ie browsers that do not support H5 to accept H5 and C3.
1.html 5shiv. jsHtml5shiv. js allows html5 labels to be supported by browsers that do not support html5. Html5's new elements cannot be child elements wrapped as parent nodes, and CSS styles cannot be applied. Html5shiv is very simple to use. Considering IE9 supports html5, you must add the following code to the head of the page.
<!--[ifltIE9]>
<script
Type = "text/javascript" src = "scripts/html5shiv. js"> </script>
<![endif]-->
If the version is earlier than IE9, html5shiv. js will be introduced. Browsers earlier than IE9 will be able to use h5 labels and the defined styles.
2. Respond. js
Respond. js is a fast and lightweight polyfill (annotation 1) that provides the min-width and max-width features of Media Queries for IE6-8 and other browsers that do not support CSS3 Media Queries, implement Responsive Web Design ).
Note 1:What is shim? What is polyfill?
Shim: a library that introduces a new API to an old environment and is implemented only by the existing methods in the old environment.
Polyfill: a shim used in browser APIs. we usually check whether the browser supports an API first. If not, load the corresponding polyfill. then the New and Old browsers can use this API. the term polyfill comes from a home decoration product Polyfilla.
It is also very convenient to use ~ Same as above!
<!--[ifltIE9]>
<script
Type = "text/javascript" src = "scripts/respond. js"> </script>
<![endif]-->
3. MiscellaneousOf course, these two are just the two js plug-ins I used. There are still many solutions to solve the problem that IE8 was previously used and that the old browser does not support H5. For example, PIE. js. With these things, I can feel at ease and rush into the arms of h5. PS: the blogger is the backend, and I am a bit confused... Hahaha