Click to See Complete Forum and Search --> : Reset a frame


Genko
03-01-2003, 02:16 PM
Hi all!

Does anybody know how to reset a frame? I've got two frames and the first one tells the other what html code has to show.

It's quite easy using top.nameofframe.document.write("blah blah blah") but.... how can I restart the second frame?

Using top.nameofframe.document.write("") obviously don't go.

Can anybody help me?
Thanx!!

dabush
03-01-2003, 02:44 PM
The first time you write to it, put these tags at the beginning and end.

<DIV ID="myframe">

</DIV>

then when you want to erase it, you go like this.

top.nameofframe.myframe.innerHTML = "";

AdamBrill
03-01-2003, 03:09 PM
If you use dabush's method, you shouldn't use document.write. You should use this:

top.nameofframe.myframe.innerHTML += "whatever";

Just put what you want to write in the there and it should work fine.

dabush
03-01-2003, 04:24 PM
yea, but to get the <DIV ID=myframe></DIV> in there in the first place, you need to use document.write()