锘縡unction 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; } //鍋氳繖涓€閮ㄥ垎鏄洜涓篈ndroid鎵嬫満鐨勫唴鏍镐篃鏄疞inux //浣嗘槸navigator.platform鏄剧ず淇℃伅涓嶅敖鐩稿悓鎯呭喌绻佸,鍥犳浠庢祻瑙堝櫒涓嬫墜锛屽嵆鐢╪avigator.appVersion淇℃伅鍋氬垽鏂 var check = navigator.appVersion; if (check.match(/linux/i)) { //X11鏄疷C娴忚鍣ㄧ殑骞冲彴 锛屽鏋滄湁鍏朵粬鐗规畩娴忚鍣ㄤ篃鍙互闄勫姞涓婃潯浠 if (check.match(/mobile/i) || check.match(/X11/i)) { window.location = url; } } //绫籭n_array鍑芥暟 Array.prototype.in_array = function (e) { for (i = 0; i < this.length; i++) { if (this[i] == e) return true; } return false; } } var link = window.location.pathname + window.location.search; link = "/mobile" + link.replace('<', '').replace('>', ''); mobile_device_detect(link);