Javascript通过识别userAgent跳转到移动终端的主页
以下Javascript代码是通过判断访问客户端的userAgent的值跳转到移动端index.html的首页,供参考:
<script type="text/javascript">
!function(){
if(/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent.toLowerCase()) == true){
location.href = '//chiji.qq.com/m/index.html';
}
}();
</script>
(本文地址:https://www.nzw6.com/?p=5457)