How to allow users to enter the WAP mobile website URL when automatically jump to WAP site?
WAP page automatic jump to achieve the way?
How can I tell if a visitor is a mobile device access and automatically jump to a WAP page?
Mobile phone automatically jump to the mobile page, a Web site to distinguish between ordinary access and mobile phone access?
When the mobile phone access to the site domain name, if the implementation of automatic jump to WAP page?
This article can solve these problems!
Copy Code code as follows:
function Is_mobile () {
var regex_match =/(nokia|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod| blazer|netfront|helio|hosin|huawei|novarra| coolpad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s[cg]h|^lge|ericsson| Philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-| Longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320| 240x320|176x220)/I;
var u = navigator.useragent;
if (null = u) {
return true;
}
var result = regex_match.exec (u);
if (Null = result) {
return False
} else {
return True
}
}
if (Is_mobile ()) {
document.location.href= '/wap ';
}
The above is the JS code only need to change the/wap to you need to jump to the page can be