2012-11-26 1 views
2

고객이 동일한 콘텐츠를 가진 두 개의 웹 사이트가 있으므로 도메인 중 하나에서 마스크 된 전달을 사용하여 두 사이트가 여전히 존재하는 것처럼 느껴집니다.마스크 된 도메인에있을 때 Windows 위치 변경 강제 적용

자바 스크립트와 함께 sweet try catch를 사용하여 jQuery에서 사소한 미적 변화를 만들기 위해 마스크 처리 된 프레임을 통해 사이트에 액세스하고 있는지 확인합니다. 머리글 링크를 사용하여 실제 도메인으로 사이트의 마스크 버전에서 가고 싶은 경우

try 
{ 
if (top.document.domain != self.document.domain); 
} 
catch(e) 
{ 
// jQuery to change a few colors and positions. 
} 

이 모든

을 제외하고 환상적으로 작동이 실패하고 힘은 당신이 마스크 버전에 머물 , 우리가 Windows 위치를 변경하는 데 사용하는 방법에 관계없이.

마스크 된 전달을 사용하지 않고 헤더 링크가 iframe 외부에 있도록 iframe을 사용자 정의하면이 문제를 피할 수 있습니다. 그러나 우리는 IT 부서에 개입해야하므로 변경을 꺼리게됩니다. 해결책이 없다면 우리는 분명히 이것을 할 것입니다. 여기에 하나가 있기를 바랍니다! 실제 작업 사이트에

링크 :

복면 도메인 : http://mdpa.com/

실제 도메인 : http://worthe.com/

+0

당신은 행동이의 예를 게시 할 수 있습니다. – gkiely

답변

1

당신은 헤더 링크의 대상을 변경하여 달성 할 수있다.

target="_top" 

대상 속성이 없으면 기본값은 iframe입니다. onclick 속성을 사용하고 있기 때문에 (필요하지 않은 것처럼) 변경해야합니다.

window.top.location='something' 
이에서 실제 도메인의 헤더 링크 코드를 변경

이에

<a href="http://worthe.com" onclick="window.location='http://worthe.com'; return false;" class="logo" id="logo-worthe">Worthe Real Estate Group</a> 
<a href="http://mdpa.com" onclick="window.location='http://mdpa.com'; return false;" class="logo" id="logo-mdpa">M. David Paul and Associates</a> 
<a href="http://worthe.com" onclick="window.location='http://worthe.com'; return false;" class="logo" id="logo-krismar">Krismar Construction</a> 

:

<a href="http://worthe.com" onclick="window.top.location='http://worthe.com'; return false;" class="logo" id="logo-worthe" target="_top">Worthe Real Estate Group</a> 
<a href="http://mdpa.com" onclick="window.top.location='http://mdpa.com'; return false;" class="logo" id="logo-mdpa" target="_top">M. David Paul and Associates</a> 
<a href="http://worthe.com" onclick="window.top.location='http://worthe.com'; return false;" class="logo" id="logo-krismar" target="_top">Krismar Construction</a>