Html 响应后释放Iframe。重新选择第2部分
我把我的主要问题搞砸了,所以我又来了 我有一个mainrecord.html,它使用iframe来显示2个html-顶部和底部。在html页面的顶部,我有一个保存按钮。这个保存按钮执行一些数据工作,然后转到另一个html。问题是较低的iframe仍然存在。以下是mainrecord.html中的内容:Html 响应后释放Iframe。重新选择第2部分,html,iframe,Html,Iframe,我把我的主要问题搞砸了,所以我又来了 我有一个mainrecord.html,它使用iframe来显示2个html-顶部和底部。在html页面的顶部,我有一个保存按钮。这个保存按钮执行一些数据工作,然后转到另一个html。问题是较低的iframe仍然存在。以下是mainrecord.html中的内容: <iframe scrolling="no" noresize target="middle" src="<%=JustPath(oProp.ScriptPath)+[/top.htm
<iframe scrolling="no" noresize target="middle" src="<%=JustPath(oProp.ScriptPath)+[/top.html?id=]+tmpid"%> name="top" height="62%" class="auto-style1" style="width: 100%">You need a Frames Capable browser to view this content.</iframe>
<iframe scrolling="no" noresize target="middle" src="<%=JustPath(oProp.ScriptPath)+[/lower.html?id=]+tmpid"%> name="lower" style="width: 100%; height: 35%">You need a Frames Capable browser to view this content.</iframe>
<script type = "text/javascript" >
element = document.getElementById("lower");
</script>
name=“top”height=“62%”class=“auto-style1”style=“width:100%”您需要一个支持框架的浏览器来查看此内容。
name=“lower”style=“width:100%;height:35%”您需要一个支持框架的浏览器来查看此内容。
元素=document.getElementById(“下”);
在top.html中有一个save按钮,该按钮指向saverecord.html。我做了一些数据工作,然后我做了以下工作:
<script type="text/javascript">
document.removeChild(element);
</script>
<% oResponse.Redirect(JUSTPATH(oProp.ScriptPath)+[/viewrecords.html])%>
文件。removeChild(元素);
它正确显示viewrecords.html。但是,包含lower.html的iframe仍然存在
有什么建议吗
TIA。您需要在JS中引用一个包装元素来删除这个Iframe
<div class="frame2">
<iframe scrolling="no" noresize target="middle" src=""..." name="lower" style="width: 100%; height: 35%">You need a Frames Capable browser to view this content.</iframe>
</div>
您没有投票支持或选择上一个问题的答案。这次为什么有人要帮你?我道歉。我正试图回答前面的答案,结果却弄得一团糟。所以,请,任何帮助都将不胜感激。谢谢。我还没有完全做到这一点,但我走在正确的轨道上。
element = document.getElementById("frame2"); <-- this is the wrapper for your Iframe
document.removeChild(element);