码迷,mamicode.com
首页 > 移动开发 > 详细

js判断PC端还是手机端

时间:2018-03-27 18:40:13      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:ref   pos   post   useragent   ipo   test   navigator   nav   black   


if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { window.location.href = "手机版网址"; } else { window.location.href = "PC端网址"; }
 

js判断PC端还是手机端

标签:ref   pos   post   useragent   ipo   test   navigator   nav   black   

原文地址:https://www.cnblogs.com/go-wandering/p/8658566.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!