How do I replace the content of a window.open after it's open

How do I replace the content of a window.open after it's open

Hello,

I have ui tabs in a popup that's been opened by a window.open.

The contents of all the tabs are generated from different cgi programs.

How would I change the content of the popup after clicking on a new tab. And have another program replace the html of the popup using cgi. Ive tried:

self.location, location.replace, location.assign. Each one gives various errors.

Any suggestions?