mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-21 04:21:32 +02:00
Refactor IE check.
This commit is contained in:
@@ -5,6 +5,7 @@ doctype html
|
|||||||
html(class='no-js', lang='en')
|
html(class='no-js', lang='en')
|
||||||
|
|
||||||
head
|
head
|
||||||
|
<!--[if lt IE 10]><meta id='no-browser'><![endif]-->
|
||||||
meta(charset='utf-8')
|
meta(charset='utf-8')
|
||||||
meta(http-equiv='x-ua-compatible', content='ie=edge')
|
meta(http-equiv='x-ua-compatible', content='ie=edge')
|
||||||
title #{title}
|
title #{title}
|
||||||
|
@@ -1,14 +1,11 @@
|
|||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
var doc = document;
|
||||||
|
var el = doc.documentElement;
|
||||||
document.documentElement.className = '';
|
var id = 'no-browser';
|
||||||
var el = document.createElement('i');
|
el.className = '';
|
||||||
el.innerHTML = '<!--[if lt IE 10]><br><![endif]-->';
|
if (doc.getElementById(id)) {
|
||||||
var browser = el.getElementsByTagName('br').length === 0;
|
el.className = id;
|
||||||
|
throw id;
|
||||||
if (!browser) {
|
|
||||||
document.documentElement.className = 'no-browser';
|
|
||||||
throw 'no-browser';
|
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user