Here is my problem. For example lets say you have the following code in the body of an asp page..
<form id="form1" runat="server">
<table style="width: 100%; height: 493px; vertical-align:top" align="left">
<tr>
<td id="Col1"><iframe id="IF1" style="width:100%; height:100%"></iframe></td>
<td id="Col2"></td>
</tr>
</table>
<input type="button" value="Unload iframe 2" onclick="UnloadPage2();"/>
<script type="text/javascript" language="javascript">
var c2 = document.getElementById('Col2');
var if2 = document.createElement("iframe");
if2.style.width = 200;
if2.style.height = 100;
if2.id = 'IF2';
c2.appendChild(if2);
var if_1 = document.getElementById('IF1');
var if_2 = document.getElementById('IF2');
if_1.src = "HTML1.htm";
if_2.src = "HTML2.htm";
function UnloadPage2()
{
var i2 = document.getElementById('Col2');
i2.removeChild(i2.lastChild);
}
HTML2.htm contains the following code in the body..
<p>This is the one that causes the message box</p>
<script type="text/javascript" language="javascript">
var mytest = setInterval(test_sayHi,5000);
function test_sayHi()
{
alert('Hello world');
}
</script>
The question is why does the interval keep elapsing even after I remove the iframe with the button click on the main asp page.
<form id="form1" runat="server">
<table style="width: 100%; height: 493px; vertical-align:top" align="left">
<tr>
<td id="Col1"><iframe id="IF1" style="width:100%; height:100%"></iframe></td>
<td id="Col2"></td>
</tr>
</table>
<input type="button" value="Unload iframe 2" onclick="UnloadPage2();"/>
<script type="text/javascript" language="javascript">
var c2 = document.getElementById('Col2');
var if2 = document.createElement("iframe");
if2.style.width = 200;
if2.style.height = 100;
if2.id = 'IF2';
c2.appendChild(if2);
var if_1 = document.getElementById('IF1');
var if_2 = document.getElementById('IF2');
if_1.src = "HTML1.htm";
if_2.src = "HTML2.htm";
function UnloadPage2()
{
var i2 = document.getElementById('Col2');
i2.removeChild(i2.lastChild);
}
HTML2.htm contains the following code in the body..
<p>This is the one that causes the message box</p>
<script type="text/javascript" language="javascript">
var mytest = setInterval(test_sayHi,5000);
function test_sayHi()
{
alert('Hello world');
}
</script>
The question is why does the interval keep elapsing even after I remove the iframe with the button click on the main asp page.