Jul 12, 2006 - 03:53 PM
You could always set the style display: none to it...it wouldn't actually "clear" the iframe, but it would hide it from view.
document.getElementById(iframe).style.display = none; should do the trick...
Past that, loading the iframe with a blank document would be about the only way to "clear" it out.
Aug 24, 2006 - 11:21 PM
Here's another possibility:
If "windowRef" is a reference to the window object of the frame you want
to close, then
should do it.
Sep 03, 2006 - 11:59 AM
so if I have
how do I get the reference to the window object of that iframe in order to clear it with the "open/close" sequence?
Sep 06, 2006 - 11:11 AM
First, give the iframe a name attribute instead of the id:
x = window.frames["iframetest"];
(Or in IE just like this: x = iframetest)
Then you can do like theDude suggests:
But this more simple method also works:
x.document.body.innerHTML = "";
These solutions have been tested in Firefox 1.5 and Internet Explorer 6.
Sep 14, 2014 - 10:31 AM
edit:/ oh you want to edit an iframes content.
ermmm... i know how to do this.
er like try
<iframe id="box" blah></iframe>
var boxy = getElementsById("box");
boxy.document.value = textareaname.value;