2014-04-20 1 views
1

iframe 내에서 작동하는 사이트가 있고 iframe을 분해하여 다른 사이트로 리디렉션하려는 경우 현재 URL 또는 iframe을 유지 관리하지 않고 자체 URL이있는 전체 새 사이트를 열어야합니다.iframe에서 이탈하는 방법은 무엇입니까?

나는 그들이 나를 위해 운동 didnt는

<meta http-equiv="refresh" content="0"; URL="http://www.newsite.com/newurl.html"> 
and 
header ('Location:http://www.newsite.com/'); 

을 시도했습니다.

답변

1

이 시도 :

<script type="text/javascript"> 
    if (top.location!= self.location) { 
     top.location = 'http://www.newsite.com/'; 
    } 
</script> 

을이 그것을 http://www.newsite.com/에 부모 윈도우를 리디렉션은 iframe 내에서 실행합니다.

관련 문제