Skip to content

Latest commit

 

History

History
4 lines (3 loc) · 1.01 KB

README.md

File metadata and controls

4 lines (3 loc) · 1.01 KB

old-ie-checker

Code snippet to inject into your site to tell users on older IE browsers to update. Just copy & paste the script into your website, and it'll do the rest for you.

Add it into your site via <script async>var ua = navigator.userAgent.toLowerCase(), oldIe = '<div id="old-ie-user" style="background:#000;padding:10px;color:#fff"><p style="max-width:1000px;margin:auto">We see you&rsquo;re using an older version of your web browser, Internet Explorer. We suggest <a href="https://www.microsoft.com/en-us/download/internet-explorer.aspx" target="_blank">upgrading to the latest version</a> today. Browsing the web in this version is not as safe as a more modern browser, and you might be vulnerable to phising attacks or worse. We also suggest downloading and using <a href="https://www.google.com/chrome/browser/" target="_blank">Google Chrome</a> instead.</p></div>', body = document.body; function insertIE() { body.insertAdjacentHTML('afterbegin', oldIe); } if (ua.indexOf('msie') !== -1) insertIE();</script>.