iecap
Version:
JavaScript library to detect the version of Internet Explorer and display a warning screen
35 lines (26 loc) • 977 B
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>IE cap</title>
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:300,400,900">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" media="all">
<link rel="stylesheet" href="styles.css" media="all">
</head>
<body>
<div class="container">
<h1>IE cap</h1>
<h2>JavaScript library to detect the version of Internet Explorer and display a warning screen.</h2>
<div class="container-output" id="iecap-output">Open this page in IE9 or less.</div>
</div>
<script src="../iecap.min.js"></script>
<script>
var ie = iecap.displayVersion();
if(ie && ie <= 9) {
document.getElementById('iecap-output').innerHTML = "Why did you do this? Don't use IE.";
}
</script>
</body>
</html>