detect if browser supports CSS3 media query - Javascript Language Basics

Javascript examples for Language Basics:Introduction

Description

detect if browser supports CSS3 media query

Demo Code

ResultView the demo in separate window

<html lang="en">
   <head> 
      <title>Are media querries supported?</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*from  w ww  . jav a 2  s.  c o  m*/
if(typeof window.matchMedia != "undefined" || typeof window.msMatchMedia != "undefined")
{
   console.log("media querries are supported!");
}else{
   console.log("no media query support");
}
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials