判断PC端和移动端访问跳转不同域名js代码

js判断跳转代码

<script type="text/javascript"> (function(){ var ua = window.navigator.userAgent.toLowerCase(); if (!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))) { window.location.href = "PC端跳转地址"; } else if (ua.indexOf("iphone") > 0 || ua.indexOf("android") > 0) { window.location.href = "移动端跳转地址"; } }()); </script>