gpt4 book ai didi

asp.net - 如何在 iframe 中提交后刷新 iframe 父页面?

转载 作者:太空狗 更新时间:2023-10-29 14:05:34 24 4
gpt4 key购买 nike

我在一个页面中有 iframe,这个 iframe 包含一个提交按钮,它将执行一些功能。

我要的是:iframe提交完成后,调用父页面刷新。

我知道如何刷新它:

parent.location.reload();

但我不知道提交完成后该怎么做。

最佳答案

在您的 iframe 上使用 onload 事件处理程序。当它在提交后触发时,执行你的 top.location.reload...

// In parent
window.onload = function() {
document.getElementById("MY_IFRAME").onload = function() {
top.location.reload();
}
}

关于asp.net - 如何在 iframe 中提交后刷新 iframe 父页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1860673/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com