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