I have this code that uses an if screen.width is > 490 then window.location = "..." What I want to do instead is use parse ini files to check for a query string inside the ini file which will append on the index page and continue over to the other pages something like, "?option=mobile" My pages use upsells so it needs to check for the screen size only once (to save on bandwidth)
At the beginning of the page: <script type="text/javascript"> if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i) ){ window.location.href = "http://yoursite.com/?option=mobile" } Code (markup): It detects if the browser is a Mobile and redirect to http://yoursite.com/?option=mobile. Hope this help! Cheers!