手机访问网页地址跳转手机站代码

手机访问网页地址跳转手机站代码
以下代码放到<head>下面一行!


<script type="text/javascript">
var strURL=window.location.href;
var str_t=parseInt(strURL.split("?")[1]);
var iphoneUrl = "http://wap.qq.com";
if(/iphone|nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|wap|android|iPod/i.test(navigator.userAgent.toLowerCase())){
document.location.href = iphoneUrl;
}
</script>

posted @ 2015-10-21 13:24  tianqi123  阅读(274)  评论(0编辑  收藏  举报