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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.