检测手机跳转链接

<script type="text/javascript">
function isMobile() {
if((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
return true;
} else {
return false;
}
}
var urlMobile = '链接'; //手机跳转的页面
if(isMobile() !== false)
window.location.href = urlMobile;
</script>

posted @ 2019-11-20 10:05  blogs-[字母控]  阅读(255)  评论(0编辑  收藏  举报