How to check browser support html5?
-
Some browsers implement different parts of HTML5. It's always best to check for a specific feature you want to use rather than HTML5 as a whole.Chris Simpson– Chris Simpson2010-10-06 22:56:04 +00:00Commented Oct 6, 2010 at 22:56
-
Serverside should not care if the browser supports HTML5, ever... These checks should be done clientside through feature detection using libraries like has.js or modernizr.js. If you need serverside HTML5 support detection, you're doing it wrong!BGerrissen– BGerrissen2011-11-10 12:55:48 +00:00Commented Nov 10, 2011 at 12:55
-
2I disagree that the server should never care if the browser supports HTML5 features. That idea completely ignores the concept of dynamic page generation. Client-side only detection removes the option for the server-side code to deliver a page that is optimized for the target browser environment. As a result, more code is needed on the client side, increasing load times and introducing more chances for bugs. I think one of the most glaring flaws of HTML5 is failing to define an HTTP header for the browser to inform the server about what capabilities the browser supports.Mike Fulton– Mike Fulton2013-09-12 00:09:18 +00:00Commented Sep 12, 2013 at 0:09
Add a comment
|
1 Answer
You could do this by matching Request.Browser.Type against a list of browsers that support html5.
3 Comments
Chris Simpson
As a general rule you should never check for a specific browser and instead always check for the feature you want to use.
user468524
I know that, but there's no way of testing html5 support server-side, and because every html5 browser is fully backwards compatible, it doesn't matter if an unknown html5 browser is served html4/xhtml.
mbomb007
@user468524 "every html5 browser is fully backwards compatible" - not true.