Detect mobile browsers and forward with Javascript

<script type="text/javascript">// <![CDATA[  
    var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));  
    if (mobile) {  
        document.location = "http://www.yoursite.com/mobile.html";  
    }  
// ]]></script>

Leave a Reply

Your email address will not be published. Required fields are marked *