2011-09-24 5 views
0

이 사이트는 .mobi 사이트로 리디렉션되지 않습니다. 그 이유는 리디렉션 스크립트가 "헤드"의 맨 위에 있지 않고 먼저 호출되는 다른 스크립트와 충돌하기 때문입니까? 어떤 제안? 다른 사람들은 머리 부분에 있어야한다고 말하고있는 것 같습니다. 그것은 비록 작동하지 않습니다.JQuery Mobile Redirect Help

호스팅 업체가 코드를 입력했으나 하단에 넣었습니다. 이것이 리디렉션되지 않는 이유라고 생각하십니까? 나는 그 (것)들에 그것을두기 위하여 요구했다. 그리고 나는 그들이 잊었을다고 생각한다. 내가 다시 해보기를 요구하기 전에 이것이 문제를 일으킬 수 있는지에 대한 의견을 듣고 싶었습니다. http://www.cpadallas.com 주요 문제의 소스 코드를 보면

<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|windows\sce|palm/i.test(navigator.user 

Agent.toLowerCase())); 

if (mobile) { 

document.location = "http://www.cpadallas.mobi"; 

} 

// ]]></script> 



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

여기에 jquery가 필요합니다. – atilkan

답변

3

정규식 여러 줄에 걸쳐 것입니다.

당신은

 

&ltscript type="text/javascript"> 
var mobile = (/iphone|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())); 

if (mobile) { 
    document.location = "http://www.cpadallas.mobi"; 
} 

</script> 

내가 미래에보다 강력한 리디렉션 전략을보고하는 것이 좋습니다 것으로 변경할 수 있습니다.

+0

헤이 배리 당신은 단지 그 공간을 삭제하는 것을 의미합니까, 그렇지 않다는 것을 의미합니까? – user962995

+0

방금 ​​사용자와 에이전트 사이에있는 여분의 줄 바꿈을 삭제하는 것을 의미했습니다 – Barry

+0

Javascript 모바일 리디렉션 스크립트를 검색하는 모든 사용자에게. 이거 야. 배리 고마워. – ntgCleaner