471,091 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Clear a document?

Just a quick question folks - is it possible
to clear a document, frame or iframe
of its entire contents? I know there's
document.clear(), but it doesn't seem to
do anything. :-(
Jul 23 '05 #1
2 7618
Alan Fiddis wrote on 05 dec 2004 in comp.lang.javascript:
Just a quick question folks - is it possible
to clear a document, frame or iframe
of its entire contents? I know there's
document.clear(), but it doesn't seem to
do anything. :-(


Do a document.write('empty, haha!') after the page is displayed.
You will lose even all javascript after that.
Jul 23 '05 #2
"Alan Fiddis" <Al********@Yahoo.co.uk> wrote in message news:<31*************@individual.net>...
Just a quick question folks - is it possible
to clear a document, frame or iframe
of its entire contents? I know there's
document.clear(), but it doesn't seem to
do anything. :-(


[windowRef/frameRef].location = 'about:blank'
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rob Videtta | last post: by
2 posts views Thread by Jack Black | last post: by
2 posts views Thread by Bill S. | last post: by
1 post views Thread by JeeperDude | last post: by
6 posts views Thread by trope | 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.