Click to See Complete Forum and Search --> : pop-up window content


dmarinic
01-07-2003, 08:34 PM
This is probably a simple one, but I'm pretty new to JavaScript so any help is highly appreciated.

Basically, I' have a function which opens up a new window with the content passed in a variable while calling a function. To be more specific here is the function:

function windowOpen() {
wheight = ( browser == "$nn") ? "200" : "100";
wwidth = ( browser == "$nn") ? "200" : "450";
opts = 'width=' + wwidth + ',height=' + wheight + ',resizable=no' + ',status=no';
msgWin=window.open( "",'helpWin', opts);
msgWin.document.write
("<HEAD><TITLE> eMOP Help </TITLE></HEAD>")
msgWin.document.write
("<CENTER><BIG><B>eMop Help:</B></BIG><BR></CENTER>")
msgWin.document.writeln (popMsg)
msgWin.focus()
msgWin.document.write
("<BR><BR><a href='javascript:window.close()'><B>Close Help</B></a>")
}

The content of the new window is passed in "popMsg" variable.
I'm trying to find out how you can replace the content of the pop-up window if it's already open and the function is called with a different variable.
The result I'm getting now is that this variable is appended to the existing one in the "msgWin", and I certainly don't want that. I want the new variable to overwrite the existing one, so the window displays only a text supplied in the last "popMsg" variable.
Is there a way to do that???
This is most probably something to do with 'onBlur" event of the pop-up window, but I'm not quite sure what to execute with it?

Thanks a million in advance,
Dali

dmarinic
01-07-2003, 11:07 PM
Thanks a lot Dave. Your suggestion is exactly what I needed.
Cheers,