(function () {
var res = getrequest ();
var par = res[' index '];
if (par!= ' Gfan ') {
var ua=navigator.useragent.tolowercase ();
var contains=function (A, b) {
if (A.indexof (b)!=-1) {return true;}
};
Change the following http://m.baidu.com to your WAP mobile address, such as http://3g.baidu.com
var tomobilevertion = function () {
window.location.href = ' http://3g.baidu.com/'
}
If (Contains (UA, "ipad") | | (Contains (UA, "rv:1.2.3.4")) | | (Contains (UA, "0.0.0.0")) | | (Contains (UA, "8.0.552.237"))) {return False}
if ((Contains (UA, "Android") && contains (UA, "mobile")) | | (Contains (UA, "Android") && contains (UA, "Mozilla")) | | (Contains (UA, "Android") && contains (UA, "opera"))
|| Contains (UA, "Ucweb7") | | Contains (UA, "iphone")) {tomobilevertion ();}
}
})();
function Getrequest () {
var url = location.search; Gets the URL in the "?" String after the character
var therequest = new Object ();
if (Url.indexof ("?")! =-1) {
var str = URL.SUBSTR (1);
STRs = Str.split ("&");
for (var i = 0; i < strs.length; i + +) {
Therequest[strs[i].split ("=") [0]]=unescape (Strs[i].split ("=") [1]);
}
}
return therequest;
}
Website Mobile browsing Judgment code