471,337 Members | 1,068 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Clear the contents of a frame/iframe?

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
2 16143
"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
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.

Similar topics

2 posts views Thread by Halldór Ísak Gylfason | last post: by
3 posts views Thread by John Chen | last post: by
2 posts views Thread by Alan Fiddis | last post: by
3 posts views Thread by Vongza | last post: by
6 posts views Thread by DRS.Usenet | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.