js 判断浏览器处于pc端或手机端

版权声明:未经同意,不得随意转载转载 https://blog.csdn.net/lucky541788/article/details/85240128
if (/Android|webOS|iPhone|iPod|BlackBerry/g.test(navigator.userAgent)) {
    window.location.href = "http://phone";
} else {
    window.location.href = "http://computer";
}

猜你喜欢

转载自blog.csdn.net/lucky541788/article/details/85240128