JS判读是否是移动端访问。如果是移动端,跳转到移动端网站。
<script type="text/javascript">
var uaInfo = navigator.userAgent;
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod", "HTC", "blackberry");
for (var v = 0; v < Agents.length; v++) {
if (uaInfo.indexOf(Agents[v]) > 0) {
//如果是移动设置,则跳转到mobile站。
//window.location.replace("http://m.xxx.com");
}
}
</script>


被折叠的 条评论
为什么被折叠?



