HTML5-JS file - let IE browsers support HTML5 standards

time:17-03-22 forum:HTML web page, JS language and code
  https://my.oschina.net/JeeChou/blog/198464

comes up with a lot of attention from the standard of HTML5, and it is also a great concern to be able to support the standard as the largest user of the world's largest user. A problem, let IE (including IE6) support the HTML5 element, and we need to add the following JavaScript to the HTML header, which is a simple document.createElement declaration that uses the conditional annotation to call the JS file for the IE. Opera, FireFox and other non IE browsers will ignore this code, and there will be no HTTP request.

[code].lt;! -.#91; if IE.#93;.Gt;
.lt; script src= http://html5shiv.googlecode.com/svn/trunk/html5.js. The tml5.js file must be added to the head element of the page, because the IE browser must know the element before the element parsing, so the JS file cannot be called at the bottom of the page.

this HTML5 JS file is provided by the author on Google code project for direct calls, of course, if it feels that this will affect your web opening speed, you can download the HTML5's JS file directly and upload it to your own server individually.

the code in the JS file of HTML5:
[code]/*
HTML5 Shiv v3.7.0 @afarkas @jdalton @jon_neal. O.#93;.#93; b|| (b={}, h, a.#91; o.#93; =h, n.#91; h.#93; =b); .test (a)? C.frag.appendChild (b): b}function t (a, b) {if (a, b) {if (b.cache) b.cache={}. Eturn function () {var n=f.cloneNode (), c=n.createElement; h.shivMethods.amp;.Amp;.Quot; m ().Join ().Replace. J.amp;.Amp; b.hasCSS) {var C, d=a; c=d.createElement (.Quot; p.quot;); d=d.getElementsByTagName (.Quot; head.quot;). Te{display:none}.lt; /style.gt;.Quot;
c=d.insertBefore (c.lastChild, d.firstChild); b.hasCSS=!! c}g||t (a, b); Tbody|td|th|tr|ul) $/i, J, o=.quot; _html5shiv.quot; h=0, n={}, G; (function) {try{var a=f.createElement; Efined.quot; ==typeof c.cloneNode||
.quot; undefined.quot; ==typeof c.createDocumentFragment||.quot; undefined.quot; ==typeof c.createElement}g=b}catch (d) {g=j=! Group main mark meter NAV output progress section summary template time video.quot. F (g) return a.createDocumentFragment (); for (VaR b=b||i (a), c=b.frag.cloneNode (), d=0, e=m ().
  • 2

prev:CCTV exposed clenbuterol comeback: Delic... next:Ji'nan has issued three ways to reward i...
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   JS's code to judge the PC end jump   Alipay online donation or immediate ...   Let old version IE support HTML5   Interaction between Flash and JS   JS cross domain request, using jsonp
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