aj_ie
v1.0.0
Published
因载入顺序的关系,还需要在页面上加入 script
Downloads
3
Readme
因载入顺序的关系,还需要在页面上加入 script
// ie 兼容 html5 新元素,要写在body之前 !(function() { var appVer = navigator.appVersion.split(";"); if (appVer[1]) { var ieVersion = parseInt(appVer[1].replace(/[ ]/g, "").replace("MSIE","")); if(navigator.appName == "Microsoft Internet Explorer"&& ieVersion <=8){ var e = "main, abbr, article, aside, audio, canvas, datalist, details, dialog, eventsource, figure, footer, header, hgroup, mark, menu, meter, nav, output, progress, section, time, video".split(', '); var i= e.length; while (i--){ document.createElement(e[i]) } } } })();
// ie 兼容 bind ,写在页面底部在引入的js之前 if (!Function.prototype.bind) { Function.prototype.bind = function(oThis) { if (typeof this !== "function") { throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); } var aArgs = Array.prototype.slice.call(arguments, 1), fToBind = this, fNOP = function() {}, fBound = function() { return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); }; fNOP.prototype = this.prototype; fBound.prototype = new fNOP(); return fBound; }; }