if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent)) {
window.location.href = "https://www.baidu.com/"; //pc链接调转
} else {
window.location.href = "http://news.baidu.com/"; //手机链接跳转
}
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent)) {
window.location.href = "https://www.baidu.com/"; //pc链接调转
} else {
window.location.href = "http://news.baidu.com/"; //手机链接跳转
}
本文标题:js判断是PC端还是手机端
本文链接:https://www.haomeiwen.com/subject/gsdeaxtx.html
网友评论