You should see a warning in IE11 but not other browsers
Last active
October 5, 2020 16:13
-
-
Save shapiromatron/bae66a34e30c8d6c518676f39592fed4 to your computer and use it in GitHub Desktop.
IE11 warning
This file contains hidden or 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-us"> | |
| <head> | |
| <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> | |
| <meta charset="UTF-8" /> | |
| <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.2.2/css/bootstrap.min.css" /> | |
| <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.2.2/css/bootstrap-responsive.min.css" /> | |
| </head> | |
| <body> | |
| <div id="container"> | |
| <h1>Demo.</h1> | |
| </div> | |
| <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
| <script type="text/javascript" > | |
| var supportedBrowserCheck = function () { | |
| var isSupportedBrowser = function () { | |
| // not ideal; but <IE12 isn't supported which is primary-goal: | |
| // http://webaim.org/blog/user-agent-string-history/ | |
| var ua = navigator.userAgent.toLowerCase(), | |
| isChrome = ua.indexOf("chrome") > -1, | |
| isFirefox = ua.indexOf("firefox") > -1, | |
| isSafari = ua.indexOf("safari") > -1; | |
| return isChrome || isFirefox || isSafari; | |
| } | |
| if (!isSupportedBrowser()) { | |
| $("#container").prepend( | |
| '<div class="alert">\ | |
| <p><b>Warning:</b> Your current browser has not been tested extensively with this website, which may result in some some errors with functionality. The following browsers are fully supported:</p>\ | |
| <ul>\ | |
| <li><a href="https://www.google.com/chrome/" target="_blank">Google Chrome</a> (preferred)</li>\ | |
| <li><a href="https://www.mozilla.org/firefox/" target="_blank">Mozilla Firefox</a></li>\ | |
| <li><a href="https://www.apple.com/safari/" target="_blank">Apple Safari</a></li>\ | |
| </ul>\ | |
| <p>Please use a different browser for an optimal experience.</p>\ | |
| </div>' | |
| ); | |
| } | |
| } | |
| </script> | |
| <script type="text/javascript" id="browserCheck"> | |
| supportedBrowserCheck(); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
