I'm sorry if this has already been asked but after some heavy searching I came up with nothing. I'm trying to put in some Javascript code into an HTML page on a windows server to detect the width of the screen of the user and if it is less than 599 pixels it will redirect them to the mobile version of the site. I've tried it on 5 phones and a tablet and it works on all of them except one, a Samsung galaxy s3. It does have Javascript enabled and is less than the desired pixel amount. I'm not sure if there is a better way to redirect people to a mobile site based on if they are a mobile user or if I'm just not using the code right. The code is as follows
<script type="text/javascript">
if (screen.width <= 599) {
document.location = "http://go.wapple.net/Neal";
}
</script>
Thanks for all of your help,
Josh