Learning HTML 5: Detecting HTML5 feature supported in browser using ModernIZR

Before you go ahead and use any of the features of HTML5, it is recommended to verify that whether that particular feature is supported by target browser or not. You can verify supported feature using open source java script file ModernIZR

ModernIZR is open source java script file allows you to detect whether particular feature of HTML is supported on the target device or browser or not. You can download java script file from here.

To use it download js file and add it as script source in the header.

Below code snippet will verify whether video tag of HTML 5 is supported in browser or not.


<!DOCTYPE html >
<html>
<head>
<title>
Demo
</title>
<script src=modernizr-latest.js ></script>
<script>
alert(Modernizr.video);
</script>
</head>
<body>
<h1>debugmode</h1>
</body>
</html>


If you run above code snippet on IE9 you should get True as alert whereas on IE8 you should be getting False as alert.

Dhananjay Kumar is Developer, Blogger , Speaker, Learner , Mindcracker & Microsoft MVP.

Tagged with: , , , ,
Posted in Web
One comment on “Learning HTML 5: Detecting HTML5 feature supported in browser using ModernIZR

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Categories
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my current or previous employer's view in anyway. © Copyright 2013
Follow

Get every new post delivered to your Inbox.

Join 2,133 other followers

%d bloggers like this: