自动识别手机端电脑端跳转代码

自动识别手机端电脑端跳转代码,下面是首页跳转的代码,大家只需把下面的域名改成自己手机端的域名的即可。

<script type="text/javascript">
try {var urlhash = window.location.hash;if (!urlhash.match("fromapp"))
{if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)))
{window.location="http://xue.usaxzt.com/";}}}
catch(err)
{
}</script> 
<meta name="mobile-agent" content="format=xhtml;url=http://xue.usaxzt.com/">

使用方法:把以上代码复制到<head></head>内即可。

共享资源网提供最优质的资源集合。
共享资源网 » 自动识别手机端电脑端跳转代码

发表评论

共享资源网提供最优质的资源集合

充值中心 开启会员