I'm using HTML5. In my Javascript file, I have the following code in my Javascript file to redirect mobiles users to the mobile site. However, is there a way to redirect to the mobile site as well when the browser window is resized to 480px or below? I looked everywhere and couldn't find any solutions anywhere.
if( screen.width <= 480 || /webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ) {
window.location = "mobile.html";
}