Hi,
To start, I am not a JavaScript expert.
I am writing an internet page that should be supported by IE 4 and higher and Netscape 4 and higher.
I am using several frames and I want to add text to one frame on actions performed in another frame. Like a status report or so.
I use the following code to write a message:
function WriteMessage(Message)
{
var doc=top.config.message.document;
doc.write('> ');
doc.write(Message);
doc.writeln('<br>');
parent.config.message.scrollTo(0, 100000);
}
(I am using framesets in framesets)
When I do this, the original document is overwrittten the first time. Since I want the background to be black and I want to use another font I call this function once:
function ClearMessages()
{
var doc=parent.config.message.document;
doc.open("text/html"
doc.write('<html><head><title>Message</title><style type="text/css">body{font-family: Courier new;font-size: xx-small;}</style></head><body leftmargin="4" bgcolor="#000000" text="#ffffff">');
doc.write('<br>');
}
Now everything works fine and I am happy.
...but that is in Internet explorer 6. In 5 and lower I see the messages, one after another like it should be, but the <head> and <body> declaration are gone. The background is white.
What do I do wrong and what should I do to repair this?
thank's in advance,
Branko
To start, I am not a JavaScript expert.
I am writing an internet page that should be supported by IE 4 and higher and Netscape 4 and higher.
I am using several frames and I want to add text to one frame on actions performed in another frame. Like a status report or so.
I use the following code to write a message:
function WriteMessage(Message)
{
var doc=top.config.message.document;
doc.write('> ');
doc.write(Message);
doc.writeln('<br>');
parent.config.message.scrollTo(0, 100000);
}
(I am using framesets in framesets)
When I do this, the original document is overwrittten the first time. Since I want the background to be black and I want to use another font I call this function once:
function ClearMessages()
{
var doc=parent.config.message.document;
doc.open("text/html"
doc.write('<html><head><title>Message</title><style type="text/css">body{font-family: Courier new;font-size: xx-small;}</style></head><body leftmargin="4" bgcolor="#000000" text="#ffffff">');
doc.write('<br>');
}
Now everything works fine and I am happy.
...but that is in Internet explorer 6. In 5 and lower I see the messages, one after another like it should be, but the <head> and <body> declaration are gone. The background is white.
What do I do wrong and what should I do to repair this?
thank's in advance,
Branko