var suseragent = Window.navigator.userAgent.toLowerCase ();//Get browser information
var bisipad = Suseragent.match (/ipad/i) = = "ipad"; Ipad
var Bisiphoneos = Suseragent.match (/iphone os/i) = = "iphone OS";//iphone
var BISMIDP = Suseragent.match (/midp/i) = = "MIDP";//Mobile device
var bIsUc7 = Suseragent.match (/rv:1.2.3.4/i) = = "rv:1.2.3.4";//
var bisuc = Suseragent.match (/ucweb/i) = = "UCWeb";//ucweb browser
var bisandroid = Suseragent.match (/android/i) = = "Android";//android
var bisce = Suseragent.match (/windows ce/i) = = "Windows CE"; Windows CE Mobile System
var biswm = Suseragent.match (/windows mobile/i) = = "Windows Mobile";//windows Mobile
if (Bisipad) {//If the ipad-side page address points to
var surl = location.href;
if (!BFORCEPC) {
window.location.href = "ipad";
}
}
if (Bisiphoneos | | bisandroid) {
var surl = location.href;
if (!BFORCEPC) {
Window.location.href = "smart";
}
}
if (bismidp| | bisuc7| | bisuc| | bisce| | BISWM) {
var surl = location.href;
if (!BFORCEPC) {
Window.location.href = "M";
}
}
}
function Fgetquery (name) {//Get parameter value
var surl = window.location.search.substr (1);
var r = Surl.match (New RegExp ("(^|&)" + name + "= ([^&]*) (&|$)");
return (r = = null? NULL: (R[2]));
}
function Fshowverblock () {
if (BFORCEPC) {
Document.getelementbyidx_x ("Dv_block"). Style.display = "block";
}
else{
Document.getelementbyidx_x ("Ad_block"). Style.display = "block";
}
}
JS to judge the PC side and the mobile end