【问题标题】:Remove iframe before load page在加载页面之前删除 iframe
【发布时间】:2013-09-17 20:16:12
【问题描述】:

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

在我的网站上,我让用户在 iframe 中填写了一份surveymonkey 调查。完成调查后,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
?>

有什么建议吗?

【问题讨论】:

标签: javascript php jquery html iframe


【解决方案1】:

清理未回答的问题

你想要一个framebuster

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

【讨论】:

    猜你喜欢
    • 2015-09-11
    • 1970-01-01
    • 1970-01-01
    • 2017-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-21
    相关资源
    最近更新 更多