How to detect and redirect Phones and Tablets to a mobile website using Javascript
When making a mobile version of your website available to users, it’s important that they are automatically brought directly to it when visiting. Using JavaScript and the userAgent String and screen size detection, you can make it possible for a user to be automatically re-directed to a mobile website when they’re using a mobile device. Let’s get coding.