How can I enable the user to automatically jump to the wap website when entering the wap mobile website URL?
How does one implement automatic jump of wap pages?
How can I determine whether a visitor is accessed by a mobile device and automatically jumps to the wap page?
The mobile phone automatically jumps to the mobile phone page. Does one website distinguish between regular access and mobile access?
When a mobile phone accesses a website domain name, if it is automatically redirected to the wap page?
This article can solve these problems!
Copy codeThe Code is 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 js Code only needs to change/wap to the page you need to jump.