Last active
March 18, 2021 12:54
-
-
Save andrejsharapov/d195ff1d9772146b8781bf51c1d49719 to your computer and use it in GitHub Desktop.
if IE - [FOR NUXT] - redirects to info page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
head: { | |
meta: [ | |
], | |
link: [ | |
], | |
script: [ | |
{ | |
type: 'text/javascript', | |
src: '/ie-not-supported.js', | |
}, | |
], | |
}, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<h1>IE NOT SUPPORTED</h1> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MSIE = /Trident\/|MSIE/.test(window.navigator.userAgent); | |
// return alert('123'); | |
function ieFound() { | |
if (MSIE === true) { | |
// return alert('456'); | |
return (window.location = | |
'https://hostname/ie-not-supported.html'); | |
} | |
} | |
ieFound(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment