2012-02-15 49 views
0

我搞砸了我的主要問題,所以我在這裏我再次去。在response.rediect第2部分後發佈iframe

我有一個mainrecord.html使用iframe來顯示2個HTML - 頂部和底部。在頂部的html頁面上,我有一個保存按鈕。這個保存按鈕做一些數據工作,然後去一個不同的HTML。問題在於較低的iframe仍然存在。以下是我在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> 

在的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。

+0

你沒有投票支持或選擇從以前的問題的答案。這次爲什麼要有人幫助你? – 2012-02-15 19:04:33

+0

我很抱歉。我試圖迴應以前的答案,它只是搞砸了。所以,請,任何幫助,將不勝感激。 – user1148224 2012-02-15 19:19:51

回答

0

您需要引用您的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> 

JS

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

謝謝。我還沒有到那裏,但我正走在正確的軌道上。 – user1148224 2012-02-15 20:06:30