By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,549 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,549 IT Pros & Developers. It's quick & easy.

Clear the contents of a frame/iframe?

P: n/a
Hi, all!! Trying to clear the contents of a frame (or iframe), and can't
seem to find anything that works. Tried:
* innerHTML
* outerHTML
* document.close(); (with a number of different frame order prefixing)
* location.href='about:blank';

Anyone have any ideas for me? :) I essentially need to clear the content
WITHOUT doing any kind of post/redirect from the window.

Thanks!
Jack


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Jack Black" <ja*************@hotmail.com> writes:
Hi, all!! Trying to clear the contents of a frame (or iframe), and can't
seem to find anything that works. Tried:
* innerHTML
* outerHTML
* document.close(); (with a number of different frame order prefixing)
* location.href='about:blank';

Anyone have any ideas for me? :) I essentially need to clear the content
WITHOUT doing any kind of post/redirect from the window.


More detail about what you have done would be helpful. How did you use
innerHTML? What location did you change?

If "windowRef" is a reference to the window object of the frame you want
to close, then
windowRef.document.open();
windowRef.document.close();
should do it.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
DU
Lasse Reichstein Nielsen wrote:
"Jack Black" <ja*************@hotmail.com> writes:

Hi, all!! Trying to clear the contents of a frame (or iframe), and can't
seem to find anything that works. Tried:
* innerHTML
* outerHTML
* document.close(); (with a number of different frame order prefixing)
* location.href='about:blank';

Anyone have any ideas for me? :) I essentially need to clear the content
WITHOUT doing any kind of post/redirect from the window.

More detail about what you have done would be helpful. How did you use
innerHTML? What location did you change?

If "windowRef" is a reference to the window object of the frame you want
to close, then
windowRef.document.open();

Exactly!
"open: Open a document stream for writing. If a document exists in the
target, this method clears it."
http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-72161170
windowRef.document.close();
should do it.

/L


DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.