<script type= "Text/javascript" >functionIs_mobile () {varregex_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; varu=navigator.useragent; if(NULL==T) { return true; } varresult =regex_match.exec (U); if(NULL==result) { return false } Else{ return true } } if(Is_mobile ()) {//document.location.href= ' wap/'; }Else{//document.location.href= ' pc/'; } </script>
JS to determine whether the mobile side automatically jump to the WAP page code