"Mikko Tussunen" <af**@faef.com> writes:
I wonder, what would be the best way to write content to another frame?
Meaning that as many browsers as possible supports it.
I have a frame that reloads with a 3 second interval, and depending on if
the user has entered information in a database (chat messages), it writes
the content to another frame. The content it has written before should be
visible.
The last part is a problem. You can get around it with programming,
but it is not immediate. When you have closed the document, writing to
it will erase the previous content, and you should close the document
to make sure that it is displayed correctly.
I've tried
document.parent['framename'].document.write('TEXT'); (I believe I had some
problems with this in mozilla)
Try
parent.frames['framename'].document.write('TEXT');
document.parent['framename'].document.getElementById('msgdiv').innerHTML +=
content;
innerHTML sure isn't the best method if you want as many browsers as
possible to understand it.
To keep the old content, you can store it as a property of the frame
object after writing it to the document. Then, before writing new
content, you read it back, append the new content, document.write it
and store it in the frame again.
/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.'