html网页判断手机还是电脑登陆进入的方法

高洛峰
高洛峰 原创
2017-03-24 11:31:50 2409浏览

这篇文章详解html网页判断手机还是电脑登陆进入的方法

<script type="text/javascript">
try{
    if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
        window.location.href="mindex.html";
    }else{
        window.location.href="cindex.html";
    }
}catch(e){}
</script>

以上就是html网页判断手机还是电脑登陆进入的方法的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。