关于站点适配的问题
<script type="text/javascript">
function browserRedirect() {
var sUserAgent= ();
var bIsIpad= (/ipad/i) == "ipad";
var bIsIphoneOs= (/iphone os/i) == "iphone os";
var bIsMidp= (/midp/i) == "midp";
var bIsUc7= (/rv:) == "rv:";
var bIsUc= (/ucweb/i) == "ucweb";
var bIsAndroid= (/android/i) == "android";
var bIsCE= (/windows ce/i) == "windows ce";
var bIsWM= (/windows mobile/i) == "windows mobile";
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) { '';}
else {}
}
browserRedirect();
</script>
把上面的代码贴到PC版,就能自动识别手机访问www时进入m版,当然里面的URL要改成你的m版URL,内页也可以用这个代码的,只要你把URL在程序里面配置好自动匹配好就可以,再把下面的代码放在m端,电脑访问m端的时候会自动跳转到www端,同理内页适用:
<script type="text/javascript">
function browserRedirect() {
var sUserAgent= ();
var bIsIpad= (/ipad/i) == "ipad";
var bIsIphoneOs= (/iphone os/i) == "iphone os";
var bIsMidp= (/midp/i) == "midp";
var bIsUc7= (/rv:) == "rv:";
var bIsUc= (/ucweb/i) == "ucweb";
var bIsAndroid= (/android/i) == "android";
var bIsCE= (/windows ce/i) == "windows ce";
var bIsWM= (/windows mobile/i) == "windows mobile";
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {}
else { '';}
}
browserRedirect();
</script>