PDA

View Full Version : Targeting document.write to window.open


Tombo
04-17-2003, 06:01 AM
Hullo,


Let's say I'm opening a new pop up window:

window.open('index.htm','mainPage',settings);


And after that I have a document.write:

document.write('hello world');


the question is.... how do I make the document.write appear in the window that is opened? (ie., I want 'hello world' to appear in the new window opened named mainPage.)


And, furthermore... what if index.htm has 2 frames in it, named left and right. How do I make that document.write appear in one of the 2 frames?


(I posted this question before... it's just now I know specifically what I'm looking for.)

Skyzyx
04-17-2003, 06:44 AM
For the new window:


var newWindow=window.open(...);
newWindow.document.write(...);


For the frames is similar:


parent.frames['frameName'].document.write(...);

Tombo
04-17-2003, 05:49 PM
I'll try that out. :D

Tombo
04-17-2003, 06:15 PM
Thanks so much.

You guys rule. :thumbsup: