I can simulate a frame destruction by make the frame invisible. But if i want to totally destroy the frame then i tried a code ..but it not working properly ... just .. simply could invalidate the frame ..but still i could get the frame object reference ..
Please have a look at my code ..
The source code of
If i didn't call removeChild then i could set the src property but if i deleted then i couldn't set the src property. But still i m having the frame reference .. why it's not getting tottaly wiped out .... ?
Please have a look at my code ..
Code:
<frameset rows="50%,50%" border="1"> <frame src="controlPage.html" id="controlFrame" /> <frame src="" id="emptyFrame" /> </frameset>
Code:
<script type="text/javascript">
function destroy(){
var emptyFrame = parent.document.getElementById('emptyFrame');
emptyFrame.parentNode.removeChild(emptyFrame);
emptyFrame.src = 'http://www.google.co.in';
alert(emptyFrame);
}
</script>
</head>
<body>
<input type="button" name="ClickMe" onclick="destroy()" value="Click Me"/>
</body>
Comment