在加载页面之前删除 iframe


Remove iframe before load page

如何在页面加载之前删除 iframe?

在我的网站上,我让用户在iframe中填写调查猴调查。完成調查後,surveymonkey 會重定向到我網站網域中的一個頁面。这个新页面仍然被困在 iframe 中;我希望在加载此新页面之前删除 iframe。我尝试了以下代码,但这删除了 iframe 和我想要加载的这个新页面的内容,从而产生空白屏幕:

<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$('iframe', parent.document).remove();
});
</script>
</head>
</html>
<?php
//the content for the page I want loaded
?>

有什么建议吗?

清理未回答的问题

你想要一个框架终结者

if(top != self) top.location.replace(location);