Clear a document?

A

Alan Fiddis

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. :-(
 
E

Evertjan.

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.
 
R

RobB

Alan Fiddis said:
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'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top