<script type= "Text/javascript" > var commonurl = ' http://xxxx.com/'; 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; } } if (navigator.platform.indexOf (' IPad ')! =-1) { window.location=url; } var check = navigator.appversion; if (Check.match (/linux/i)) { if (Check.match (/mobile/i) | | check.match (/x11/i)) { window.location=url; } } Array.prototype.in_array = function (e) {for (i=0;i<this.length;i++) { if (this[i] = = e) return true; } return false; } } Mobile_device_detect ("http://wap.xxxx.com/");/* Specify a jump address */</script>
Put in a index.html file or header.html
jquery Determines whether the current device is a mobile phone or a computer and jumps