$ (function () {
var curwwwpath = Window.document.location.href;
var pathName = Window.document.location.pathname;
var pos = curwwwpath.indexof (pathName);
var localhostpaht = curwwwpath.substring (0, POS);
var host = Window.location.host;
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 (Bisipad | | bisiphoneos | | bismidp | | bIsUc7 | | bisuc | | bisandroid | | bisce | | biswm) {
Mobile
if ((Localhostpaht + "//" +host)! = ' https://m.meiwo.cn ') {
window.location.href = ' https://m.meiwo.cn ';
}
} else {
Pc
if ((Localhostpaht + "//" +host)! = ' https://www.meiwo.cn ') {
window.location.href = ' https://www.meiwo.cn ';
}
}
})
Window.location.href =/android|webos|iphone|ipad| Blackberry/i.test (navigator.useragent)? "https://www.baidu.com/": "http://news.baidu.com/";
Or
if (/android|webos|iphone|ipad| Blackberry/i.test (navigator.useragent)) { window.location.href = "https://www.baidu.com/";} else { Window.location.href = "http://news.baidu.com/";}
Determine whether the page is open on the mobile or PC side