Click to See Complete Forum and Search --> : Subwindow problem


OhLordy
09-09-2003, 11:30 AM
Right, this is a little hectic so I'll post the code first.

<script language="javascript">
var a2c_width;
var a2c_height;
var a2c_window;
function a2c_popup(a2c_height,a2c_width)
{
if(!a2c_window || a2c_window.closed)
{
a2c_window=window.open('a2c_popup.php','_blank','location=no, left=200, top=200, screenx=200, screenY=200, menubar=no, resizable=no, scrollbar=no
}
else
{
a2c_window.focus();
a2c_window.refresh();
}
}
</script>

Right so if the sub window is open and the link is clicked, rather than opening another the focus is just moved back to the subwindow. Now, if another link is clicked on the parent window and then the link to open this is clicked again (still called a2c_window) a new window is opened. What I want to happen is for the parent window to stay aware of the subwindow even after it has moved to a different page.
Hope this makes sense
Rob

Khalid Ali
09-09-2003, 11:57 AM
if you assign different names to popup windows then parent window will know about the child

window.open("url','unik_win_name_here','propertoes');

OhLordy
09-10-2003, 03:34 AM
Cool, thanks! How do I then refeerence that window in a later page for, say, focus() or close()?
Cheers
Rob