Judge Mobile WAP website Jump source

Source: Internet
Author: User

Simple method: Through the Baidu site app to judge:

Embed the following code in the header of the Web page:

<script src= "Http://siteapp.baidu.com/static/webappservice/uaredirect.js" type= "Text/javascript" ></ Script><script type= "Text/javascript" >uaredirect ("http://m.baidu.com");//Please change the URL of your mobile station to the URL of the website </script >

Here is attached uaredirect.js file source code, for yourself to learn:

functionUaredirect (f) {Try {        if(document.getElementById ("Bdmark")! =NULL) {            return        }        varb =false; if(arguments[1]) {            varE =Window.location.host; varA =window.location.href; if(Issubdomain (arguments[1], e) = = 1) {f= f + "/#m/" +A; b=true            } Else {                if(Issubdomain (arguments[1], e) = = 2) {f= f + "/#m/" +A; b=true                } Else{f=A; b=false                }            }        } Else{b=true        }        if(b) {varc =Window.location.hash; if(!c.match ("Fromapp")) {                if((Navigator.userAgent.match (/(iphone|ipod| Android|ios)/i)) {Location.replace (f)} }}}Catch(d) {}}functionIssubdomain (c, D) { This. GetDomain =function(f) {varE = F.indexof ("://"); if(E > 0) {            varH = f.substr (e + 3)        } Else {            varh =F}varg =/^www\./; if(G.test (h)) {h= H.substr (4)        }        returnh}; if(c = =d) {return1    } Else {        varc = This. GetDomain (c); varb = This. GetDomain (d); if(c = =b) {return1        } Else{C= C.replace (".", "\ \.")); varA =NewREGEXP ("\ \" + C + "$")); if(B.match (a)) {return2            } Else {                return0            }        }    }};

Judge Mobile WAP website Jump source

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.