What's the best way to check if the browser supports html5 using jQuery?

I want to use a fallback solution for HTML5 / flash audio players.

I wonder if I can use jQuery to check if HTML5 is supported.

I know there is .support() ( http://api.jquery.com/jQuery.support/ ) but I'm not sure which would be a bullet proof check.

Answers


You can test for HTML5 features using Modernizr.

http://www.modernizr.com/


Try Modernizr. From documentation:

var audio = new Audio();
audio.src = Modernizr.audio.ogg ? 'background.ogg' :
            Modernizr.audio.mp3 ? 'background.mp3' :
                                  'background.m4a';
audio.play();

EDIT: Now that the question has changed, this might be more in line with what you need.


Need Your Help

How to use RichFaces a4j:commandButton not using submit

java jsf richfaces

I have an a4j:commandButton which looks like this

Debug symbols are said to be not loaded for a document even though they are loaded for the dll

c++ visual-studio dll symbols

I have built a particular dll with debug information (compiler option /Zi and linker option /DEBUG). Through an interrupt statement in the main program, I launched the Visual Studio for debugging. ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.