Jump to content

Refresh Parent window when closing child window


Recommended Posts

Here is my code...

 

Main WIndow : (test.html)

<table cellpadding="0" cellspacing="0" width="100%">

<tr>

<td><iframe src="pages/frme.html" align="top" width="447" height="600" style="vertical-align:top; border:0px;"></iframe>

</tr>

</table>

 

frame.html :

having a hyperlink to open a popup window.

 

popup window:

having a hyperlink.

 

here is code in popup window...

onClick="javascript: return win();">xxx</a>

function win()

{

window.opener.location.href="test1.html";

self.close();

}

when am clicking on the hyperlink of the popup, the popup is closed and loaded the test1.html page in the iframe place.  But i need to open as a parent window instead of iframe.  Please any body suggested me how to solve my problem.

So I suppose you launch the popup from the iframe? And when it is closed, you don't want to load the page into the iframe (the opener of the popup), but the top location?

 

Why not create a javascript function in the iframe that sets the parent.top location and then call that function instead of this:

window.opener.location.href="test1.html";

So something like:

window.opener.setTopLocation("test1.html");

 

and then in the function setTopLocation you do:

document.top.location.href = x;

 

Please let me know what you think.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.