因爲pc,和移動的設計佈局差別很大,分別定製採起js跳轉的方式,來實現同域名下,模板切換(備忘)css
function browserRedirect() { var warpUrl = //移動端地址 var pcUrl =//PC端地址 if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){ if(window.location.href.indexOf("?mobile")<0){ try{ if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){ window.location.href = warpUrl; }else if(/iPad/i.test(navigator.userAgent)){ }else{ window.location.href = pcUrl; } }catch(e){} } } }