Reputation: 77416
I'm building a site that relies heavily on several HTML5 features. I do not want to develop a separate version of the site for IE6-8. Instead, when those users visit, I'd like a nice-looking modal to pop up to politely suggest that they visit the site with a modern browser like Chrome or Firefox. Is there an existing library that will do this for me?
Ideally, modern browsers would only have to download the browser detection code; the code powering the modal would be loaded asynchronously only when needed.
Upvotes: 4
Views: 188
Reputation: 77416
It looks like this will do the trick: https://github.com/viamarte/modernweb
Upvotes: 0
Reputation: 12675
The rule is to detect browser capabilities, not individual browsers. As pradeek mentioned, modernizr does an excellent job of this.
Upvotes: 0
Reputation: 22105
Use Modernizr. Instead of checking what browser they use, you can check for the exact feature that you need and display an alert if the current browser does not support it. Additionally, Modernizr also includes the YepNope library which lets you conditionally load resources that you need (like the modal you mentioned)
Upvotes: 3