Swap flash experience with HTML 5 experience if HTML 5 capable browser is detected
We have an interface flash video experience on our website and when a user clicks on a video testimonial, the flash experience will reveal a video for them to watch/listen, which is also in flash.
The goal is when someone reaches our website using an ios device or a HTML 5 capable browser, for example, we would like the flash experience to be swapped out to reveal the new HTML 5 experience. We're not ready to remove flash completely since we have users that don't have modern browsers just yet.
My questi开发者_JAVA技巧on is there a "check" that we can add to our site that should a user have an HTML 5 browser when they visit it, the website would swap the flash experience with our HTMl 5 experience?
For example: should a user have javascript disabled, we have it setup to swap the flash experience with a simple image in its place. We we're hoping for something similar would exsit for detecting HTML 5 capable browsers.
HTML5 is a collection of loosely-related features in HTML, Javascript and CSS.
Different browsers and versions support different subsets of those features.
You can use the Modernizr library to check for the specific features that you need.
There is no one check for HTML5 compatibility, because different browsers implement HTML5 to different degrees. The best you can do is to use JavaScript to check for the availability of all the functionality you require.
Edit: and as SLaks says, the best tool to perform your checks is Modernizr.
精彩评论