不同终端实现自动跳转到相应页面的js代码

1
2
3
4
<script type="text/javascript">    
if(/Android|webOS|iPhone|iPod|BlackBerry|Windows CE|ipad|Windows Phone/i.test(navigator.userAgent)){    
if(window.location.href.indexOf("?pc")<0){try{window.location.href="/3g/index.asp"}catch(e){}}    
}

出处:http://www.myqingfeng.info/HTML/863.html

posted @ 2017-11-09 22:34  轩辕清风  阅读(259)  评论(0)    收藏  举报