- <script>var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端 var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 var url = window.location.href; if (isAndroid == true || isiOS == true) {} else { if (url.indexOf("m.") > 0) { window.location.href = url.replace('m.', 'www.'); } }</script>
复制代码 我这是两端的,我自己在用的 |