我的页面上有iframe中的页面(具有不同的域)。但iframed页有这个代码iframe中的JS反onbeforeunload提示
<script language="JavaScript">
window.onbeforeunload = confirmExit;
function confirmExit() {
return "You have attempted to leave this page. Are you sure?";
}
</script>
所以我不能关闭父页面没有“你有企图...”的提示。这是非常恼人的提示,任何人都有想法如何阻止这种提示?
编辑:我忘了 - JS在儿童(iframed)页非常重要。我不能使用没有JS或表单的使用沙盒模式。
对不起,我忘了 - JS在孩子(的iframe)页面是非常重要的。 –
@MilanObrtlík - 然后,正如我在答案中所说的那样,你不能。 – Quentin