|
楼主 |
发表于 2021-3-11 11:41:59
|
显示全部楼层
有懂代码的人跟我说,让做网站的人把每个页面的这段代码注释掉手机端就可以打开网页了:“
function browserRedirect() {
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
if (bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
window.location.href = "/m/";
}
}
browserRedirect();
懂代码的人说只能让做网站的人注释,因为服务器是人家的,就算我自己要来源代码去注释这段代码也用不了。
是这样吗?
|
|