var eap_browser={ versions:function(){ var u = navigator.useragent, app = navigator.appversion; return { //移动终端浏览器版本信息 trident: u.indexof('trident') > -1, //ie内核 presto: u.indexof('presto') > -1, //opera内核 webkit: u.indexof('applewebkit') > -1, //苹果、谷歌内核 gecko: u.indexof('gecko') > -1 && u.indexof('khtml') == -1, //火狐内核 mobile: !!u.match(/applewebkit.*mobile.*/), //是否为移动终端 ios: !!u.match(/\(i[^;]+;( u;)? cpu.+mac os x/), //ios终端 android: u.indexof('android') > -1 || u.indexof('linux') > -1, //android终端或uc浏览器 iphone: u.indexof('iphone') > -1 , //是否为iphone或者qqhd浏览器 ipad: u.indexof('ipad') > -1, //是否ipad webapp: u.indexof('safari') == -1 //是否web应该程序,没有头部与底部 }; }(), language:(navigator.browserlanguage || navigator.language).tolowercase() } var eap_pathname = document.location.pathname; var eap_extname=eap_pathname.substring(eap_pathname.lastindexof(".")); var eap_relpath = eap_pathname.substring(1); if(eap_pathname=="/"){ if(eap_browser.versions.mobile ){ window.location="/m_index.html"; } } if(eap_extname==".html"){ if(eap_browser.versions.mobile ){ if(eap_relpath.substring(0,2)!="m_") window.location="/m_"+eap_relpath; }else{ if(eap_relpath.substring(0,2)=="m_") window.location="/"+eap_pathname.substring(3); } }