JQuery移动重定向帮助



这个网站没有重定向到。mobi网站。这是因为重定向脚本不在"头部"的顶部,并且与首先调用的其他脚本相冲突吗?有什么建议吗?其他人似乎说它只需要在头部区域。但这行不通。

托管公司输入了代码,但把它放在底部。你觉得这就是它没有重定向的原因吗?我让他们把它放在那里,我猜他们忘记了。在我要求他们再做一次之前,我想知道这是否会导致问题。

<head>
<!-- SW3 -->
<title>Rosenhouse Group, PC, a professional tax and accounting firm in Dallas, Texas</title>
<script type="text/javascript" language="javascript" src="/menu.js"></script>
<script type="text/javascript">
adroll_adv_id = "7LYERGMOVZEPTB3B62NLZD";
adroll_pix_id = "KN5CT4JO5NEKLEGKBSHDQF";
(function () {
var oldonload = window.onload;
window.onload = function(){
   __adroll_loaded=true;
   var scr = document.createElement("script");
   var host = (("https:" == document.location.protocol) ? "https://c.adroll.com" : "http://c.adroll.com");
   scr.setAttribute('async', 'true');
   scr.type = "text/javascript";
   scr.src = host + "/j/roundtrip.js";
   document.documentElement.firstChild.appendChild(scr);
   if(oldonload){oldonload()}};
}());
</script>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="icon" type="image/ico" href="favicon.ico"/>
<script src="js/jquery-latest.js" type="text/javascript"></script>
<script type="text/javascript">
    $.noConflict();
</script>
<meta name="keywords" content="Rosenhouse Group, PC, L. Minton Rosenhouse, CPA, Dallas, Texas, 75252-5897, , , , , , , , , , , , , , , , , , , , , , , , , ">
<meta name="author" content="Emochila Website Design for CPAs Lawyers and Dentists">
<meta name="description" content="">
<link rel="stylesheet" href="sb/cssfile.jsp?decider=mrosenhouse&amp;content=1500" type="text/css">
<script type="text/javascript">// <![CDATA[
var mobile =
(/iphone|ipod|android|blackberry|mini|windowssce|palm/i.test(navigator.user
Agent.toLowerCase()));
if (mobile) {
document.location = "http://www.cpadallas.mobi";
}
// ]]></script>

<meta name="google-site-verification" content="Fl04TuB3stq95hUqds8jcKHuWRjxeCjO8orCnSn1SyY" />
</head>

查看http://www.cpadallas.com的源代码,您的主要问题是正则表达式跨多行。

可以改成

吗?<>之前&ltscript type = " text/javascript ">var mobile = (/iphone|ipod|android|blackberry|mini|windowssce|palm/i.test(navigator.userAgent.toLowerCase()));If(移动){文档。位置= "http://www.cpadallas.mobi";}& lt/脚本>之前

我建议您将来考虑更健壮的重定向策略。

最新更新