While waiting for responsive design to find the way into a legacy web site, I would like to redirect a browser to a mobile version if the screen is smaller than 480px
Hunting around I came up with
var isSmall = window.matchMedia ? window.matchMedia("screen and (max-width: 480px)") : screen.width<=480;
Is this acceptable in 2014 or is there a better/safer/newer method to do what I want without using useragent sniffing?
QuirksMode screen.width is useless (hence the addition of matchMedia)