手机端和pc端识别

<script type="text/javascript">
var mobileAgent = new Array("iphone", "ipod", "ipad", "android", "mobile", "blackberry", "webos", "incognito", "webmate", "bada", "nokia", "lg", "ucweb", "skyfire");
var browser = navigator.userAgent.toLowerCase();
var isMobile = false;
for (var i=0; i<mobileAgent.length; i++){ if (browser.indexOf(mobileAgent[i])!=-1){ isMobile = true;
//alert(mobileAgent[i]);
location.href = 'http://siteapp.baidu.com/webapp/www.ssffx.com#m/http://www.ssffx.com/';
break; } }
</script>

posted @ 2015-04-21 09:22  shenming  阅读(230)  评论(0编辑  收藏  举报