4G, mobile website has been out of hand, PC end and mobile end of the website coexist. How to get someone to visit your PC-side website directly to the mobile end of the site? You reader, small two on the code! Here it comes!
The first way: the need for mobile phone-side also web page data synchronization
Copy Code code as follows:
<script type= "Text/javascript" >
(function () {var ua=navigator.useragent.tolowercase (); var bisipad=ua.match (/ipad/i) = "ipad"; var bisiphoneos= Ua.match (/iphone os/i) = "iphone OS"; var bisandroid=ua.match (/android/i) = "Android"; var Biswm=ua.match (/windows mobile/i) = = "Windows Mobile"; if (bisipad| | bisiphoneos| | bisandroid| | BISWM) {window.location.href= "http://m.jb51.net/android/game/826.html"}}) ();
</script>
The second method:
<script language= "JavaScript" > Function mobile_device_detect (URL) {var thisos=navigator.platform; var os=new Array ("IPhone", "IPod", "IPad", "Android", "Nokia", "SymbianOS", "Symbian", "Windows phone", "Phone", "Linux
ARMV71 "," MAUI "," untrusted/1.0 "," Windows CE "," BlackBerry "," Iemobile ");
for (Var i=0;i<os.length;i++) {if (Thisos.match (os[i))) {Window.location=url;
}//Because a considerable part of the mobile phone system does not know the information, here is a temporary special identification if (navigator.platform.indexOf (' IPad ')!=-1) {window.location=url; //Do this part because the Android phone's kernel is also Linux//But navigator.platform display information is different, so from the browser, that is, using navigator.appversion information to make a judgment var check =
navigator.appversion; if (Check.match (/linux/i)) {//x11 is the platform of the UC browser, if there are other special browsers you can attach the condition if (Check.match (/mobile/i) | | check.match (/x11/i)
) {Window.location=url; Class In_array Functions Array.prototype.in_array = function (e) {for (i=0;i<this.length;i++) {if (this[i] = e) r
Eturn true;
return false; } mobile_device_detect ("http:. ***.com "); </SCRIPT>
Note here the
Mobile_device_detect ("http://***.***.com");//The address inside is filled with the website address of your mobile end.