Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh the parent from sibling -Urgent

Status
Not open for further replies.

powerranger

Technical User
Feb 14, 2003
10
0
0
US
Hello,

I have main asp page where I have a button. When the user clicks on the button, a popup (popup A) will appear with a button. Once the user clicks the button on the popup A, another popup (popup B) appears and close the popup B. What I'd like to do is when the user clicks on the button that is on popup B, it will refresh the main page and close the popup B. Any sample code would help! Thank you!!
 

where the button is on winB, put this:

onclick=parent.location.refresh();

does that help?

- g
 

oops, i mean:

onclick=window.location.reload();

my bad.

- g
 
it still does not work. After the first popup it works but not after the second popup. Help!!
 
Here is the javascript from the main page:

function winopen()
{
var url = 'var map = open(url, 'popupWindow', '');
if(!map.opener)
map.opener = self;
}

Next is the javascript from the first popup where I have button with onclick="winopen()" :
<script language=&quot;javascript&quot;>
function winopen()
{
var url = 'open(url, 'Main4', '');
window.close();
return false;
}
</script>

Last, it is where it failed to refresh the parent:

<script language=javascript>
function Openwind()
{
window.opener.refresh();
window.close();
return false;
}
</script>

I guess at this point it does not know what opener is. Can you guys help me? Thanks.
 
I'm sorry there was a typo in my previous response

Here is the javascript from the main page:

function winopen()
{
var url = 'var map = open(url, 'popupWindow', '');
if(!map.opener)
map.opener = self;
}

Next is the javascript from the first popup where I have button with onclick=&quot;winopen()&quot; :
<script language=&quot;javascript&quot;>
function winopen()
{
var url = 'open(url, 'Main4', '');
window.close();
return false;
}
</script>

Last, it is where it failed to refresh the parent:

<script language=javascript>
function Openwind()
{
window.opener.refresh();
window.close();
return false;
}
</script>

I guess at this point it does not know what opener is. Can you guys help me? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top