<script type="text/javascript">
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Opera Mobi|Windows CE|Symbian|Windows Phone|POLARIS|lgtelecom|nokia|SonyEricsson|LG|SAMSUNG|Samsung/i
.test(navigator.userAgent)) {
//移动端浏览器
window.location = "http://www.baidu.com";
} else {
//PC浏览器
window.location = "http://cn.bing.com/";
}
</script>
JavaScript方式判断是否为移动端浏览器
时间: 2024-09-28 14:10:01