Refresh parent from popup?

4 posts Page 1 of 1
Contributors
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Refresh parent from popup?
CodenStuff
Hello,

I know this will probably need to be done in javascript but im either too tired or I lack the brain capacity to figure it out :lol:

Heres the scenario..I click a button which opens a popup window..I then click a button in the popup window which (A) closes the popup window (B) Refreshes the page that created the popup. Does anyone know how to do that please? :?

Basically I need the popup to refresh its parent when it closes.

Thank you cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Re: Refresh parent from popup?
GoodGuy17
Couldn't you access the parent page from the popup on Close (which is called from the click of the button) then refresh then go forth with the closing action...? I don't know JS, so I don't have any details... probably easier said then done :S
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Refresh parent from popup?
mandai
You could use this:
Code: Select all
<html>
<head>
<script type="text/javascript">

function unloaded()
{
 alert("popup closed, will refresh parent");
 window.location.reload();
}

function popup()
{
 var win = window.open("about:blank");

 win.attachEvent("onunload", unloaded);//IE
}
</script>
</head>
<body>
<p><a href="#" onclick="popup()">test</a></p>
</body>
</html>
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: Refresh parent from popup?
CodenStuff
Thanks mandai ill try that out cooll;

Thats basically all I want it to do. When a button/link is pressed inside the popup it performs an action, closes the popup..and then refreshes the page which created the popup in the first place.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
4 posts Page 1 of 1
Return to “Help & Support”