在response.rediect第2部分后发布Iframe [英] Release Iframe after response.rediect part 2

查看:113
本文介绍了在response.rediect第2部分后发布Iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个mainrecord.html,它使用iframe来显示2个html - top和lower 。在顶部的html页面上,我有一个保存按钮。这个保存按钮做一些数据工作,然后去一个不同的HTML。问题在于较低的iframe仍然存在。以下是mainrecord.html中的内容:

 < iframe scrolling =nonoresize target =middlesrc = <%= JUSTPATH(oProp.ScriptPath)+ [?/的top.html ID =] + tmpid %> name =topheight =62%class =auto-style1style =width:100%>您需要一个支持Frames的浏览器来查看此内容< / iframe> 
< iframe scrolling =nonoresize target =middlesrc =<%= JustPath(oProp.ScriptPath)+ [/ lower.html?id =] + tmpid%> name =lowerstyle =width:100%; height:35%>您需要支持Frames的浏览器才能查看此内容。< / iframe>
< script type =text / javascript>
element = document.getElementById(lower);
< / script>

在top.html中,有一个保存按钮可用于saverecord.html。我做了一些数据工作,然后我这样做:

 < script type =text / javascript> 

document.removeChild(element);

< / script>
<%oResponse.Redirect(JUSTPATH(oProp.ScriptPath)+ [/ viewrecords.html])%>

正确显示viewrecords.html。但是,包含lower.html的iframe仍然存在。



有什么建议吗?

TIA。

解决方案

您需要在您的JS中引用包装元素以移除此Iframe。

 < div class =frame2> 
< iframe scrolling =nonoresize target =middlesrc =...name =lowerstyle =width:100%; < / iframe>
< / div>
< / code>< / pre>您需要一个支持Frames的浏览器来查看此内容。

JS

  element = document.getElementById(frame2);<  -  - 这是你的Iframe 
的包装器document.removeChild(element);


I've messed up my main question so I here I go again.

I have a mainrecord.html that uses iframe to display 2 html - top and lower. On the top html page I have a save button. This save button does some data work and then goes to a different html. The problem is the lower iframe is still there. Here is what I have in the mainrecord.html:

<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>

In the top.html there is a save button that goes to a saverecord.html. I do some data work and then I do this:

<script type="text/javascript">

document.removeChild(element);

</script>
<%   oResponse.Redirect(JUSTPATH(oProp.ScriptPath)+[/viewrecords.html])%>

It correctly displays viewrecords.html. However, the iframe containing lower.html is still there.

Any suggestions?

TIA.

解决方案

You need to refer to a wrapping element in your JS to remove this 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>

JS

element = document.getElementById("frame2"); <-- this is the wrapper for your Iframe
document.removeChild(element);

这篇关于在response.rediect第2部分后发布Iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆