QUOTE(Christian J @ Aug 18 2009, 04:56 AM)

I recommend not using popups, since browsers may use popup blockers.
This was much harder than when doing similar things between frames, for some reason (or maybe I'm complicating things). Try this in the parent page:
CODE
<script type="text/javascript">
window.open('popup.html', '_blank');
function test(c)
{
alert(c);
}
</script>
...and this in the popup:
CODE
<h1>Header text</h1>
<script type="text/javascript">
window.onload=function()
{
opener.test(document.getElementsByTagName('h1')[0].innerHTML);
}
</script>
Note that the function test() in the parent page is called from the popup, that way you can make sure the popup has loaded before the function is called.
Also note that security reasons may prevent browsers from reading or writing between pages hosted on different domains.
Christian, Thanks for your response.
Let me say that this is a local client side app, similar to a widget, so I should have complete control over my browser options (except that Firefox does not want to follow instructions). I find that using a browser that supports Javascript and remote windows enables me to create many useful little apps that would be very difficult if not impossible to do in a text editor, even a text editor with macros. Even though Javascript cannot save the output to disk directly, it is very easy to save the target window manually.
For this app, I want to be able to load an arbitrary page into the remote window so modifying it or embedding code is not an option. The direction of control or access will always be from the local or "self" window to the remote window.
I have found that using remote windows is actually easier than using frames. Using frames requires a minimum of two files to keep synchronized whereas with named remote windows everything can be self contained in a single file. Most of the time I neither need nor want the output on the same page. Separate browser windows (tabs), increases the screen space and gives me more flexibility such as saving the output.
Actually, the only difference between frames and separate browser windows is one line of code:
var remoteWindow = window.open(url);
vs
var remoteWindow = parent.frameName; parent.frameName.location=url;
Subsequent code accessing "remoteWindow" doesn't care whether it is a frame window or a browser window. (Usually. There seems to be a difference in direct DOM element access. Frames are giving me a problem.]
Your comment about cross domain access restrictions motivated me to check out that possibility and that turns out to be the problem! (It had crossed my mind earlier but did not stick.) Even using the DOM element arrays remoteWindow.document.anchors[] and remoteWindow.document.images[] to access the remote window has the same roadblock.
[One "gotcha" that I found: the DOM anchors[] arrays only contains anchor elements that have a NAME ATTRIBUTE! The element array generated via getElementsByTag("a") does include all anchor elements, whether or not they have a name attribute.]
So now the problem becomes: how do I enable cross domain access in a browser?
(I only need read access, not write access.)
I realize this goes against the grain of the current security thrust of browser operation but there are legitimate needs for this ability. IE (shudder), has a cross domain switch but it does seem to have any effect. Firefox and Opera do not seem to have any relevant menu options but there may be something in about:config. Configuration options for Safari and Chrome are non-existent or a joke. Any ideas or suggestions???
BTW: I strongly recommend that you bookmark:
http://www.w3schools.com/default.asp http://www.w3schools.com/htmldom/dom_reference.asp.
It is a giant site with a wellspring of useful web developer resources, not the least of which is a complete list of all HTML elements and their properties and methods.