View Full Version : More popup windows
Dingbat
10-11-2002, 12:00 PM
Hi Guys,
I am sure that someone will have the answer to this question. I have a popup window that opens when the child window opens. I would like to know how do I close both the popup and the child window and direct to another page in a frameset?:confused:
You could try the following taking into account that
This link would be in the window that opened the popup.
The popup must be given a name
< a href="page.htm" target="framename" onclick="window.close();windowname.close()">Link</a>
framename is the target frame
windowname is the name of the popup
window.close() closes the current window
Dingbat
10-11-2002, 03:52 PM
Hi Mr J,
Thanks for that code, I regret that it didn't achieve the effect that I required.
I am really looking for some code that will open a new wondow from a frame and the when the new window is closed to return to the frameset but with a new page in the frame. I seem to think that it is along the lines of a .location to reopen the frameset.
I hope that you can assist.
Regards,
The Dingbat.:confused:
PauletteB
10-11-2002, 06:27 PM
Link to make the pop-up window:
<a href="yourpopuppage.html" target="popup"
onClick="javascript:popup=window.open('','popup','width=300,height=300,left=0,top=0')">Make Pop Window</a>
Link to close the pop-up and replace the frame with the new page:
<a href="yournewpage.html" target="NameofFrameWhereThisLinkIs"
onClick="if(popup && popup.open && !popup.closed)popup.close()">Close All & Opens New Page in frame</a>
Should work for you...
(You need to remove the spaces that the forum adds.)
See if this is what you are after
In the page/frame that is going to open the popup
<script>
function newWin(theURL)
{
var newWin=open((theURL),'','width=200,height=100,top=300,left=250' );
}
</script>
<a href="javascript:newWin('yourpage.htm');">Your Link</a>
In the page loaded into the popup
<A HREF="Your Page2.htm" target="framename" onclick="window.close(-1); return true">Link</A>
framename is the frame that the new page is loaded into
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.