pc的链接在移动端上访问,让该链接转换为移动端的链接(非响应式布局)
<script type="text/javascript">
if (/AppleWebKit.*mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))) {
window.location.href = "url";
}
</script>
用pc访问移动端页面(非手机模式下),链接转换为pc端
if (!navigator.userAgent.match(/AppleWebKit.*Mobile.*/)) {
window.location.href = "m.****.com";
}
最后,如果我的笔记对您有帮助,请给我一个赞~ 谢谢!