PC端判断屏幕宽度到达手机宽度的时候,直接跳转手机页面

<script>
// //判断屏幕宽度到达手机宽度的时候,直接跳转手机页面
// window.addEventListener("resize", function() {
// if (/Android|ios|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
// window.location.href = 'http://103.47.137.221/mob/login.html';
// }
// })
</script>
<script type="text/javascript">
(function() {
var sUserAgent = navigator.userAgent;
if (sUserAgent.indexOf('Android') > -1 || sUserAgent.indexOf('iPhone') > -1 || sUserAgent.indexOf('iPad') > -1 || sUserAgent.indexOf('iPod') > -1 || sUserAgent.indexOf('Symbian') > -1) {

location.href = 'http://103.47.137.221/mob/login.html';
} else {

}
})();
</script>
————————————————
版权声明:本文为CSDN博主「ruiguang21」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ruiguang21/article/details/79391738

上一篇:failed to allocate 2.00G (2147483648 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY: out of memory


下一篇:如何利用github打造博客专属域名