首页 > 菜鸟请教一个简单的问题

菜鸟请教一个简单的问题

<meta name="mobile-agent" content="format=html5;url=http://m.xxx.com/abc/" />
<meta name="mobile-agent" content="format=xhtml;url=http://m.xxx.com/abc/" />
<script type="text/javascript" src="http://siteapp.baidu.com/static/webappservice/uaredirect.js"></script>
<script type="text/javascript">uaredirect("http://m.xxx.com/abc/");</script>

电脑版的链接是http://www.xxx.com/abc/,查看电脑页面的源码,发现含有上述的代码用来判断手机端做跳转的,想问下,那个手机链接是怎么匹配调用的,谢谢!

看一下这个文件就都明白了嘛,: http://siteapp.baidu.com/static/webappservice/uaredirect.js , 其中应该有个 function uaredirect


一般都是先匹配手机的ua信息,如果符合就重定向。

还有判断手机分辨率的(但是不多)

【热门文章】
【热门文章】