• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with pop-up

 
Anand Jayaraman
Ranch Hand
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys!


I have a problem and I hope someone can help me out here. It goes like this:

I have a page. This page has links which opens up a pop-up window. This pop-up window has a Save button which will do some operation for the user. Once the Save button is clicked, the pop-up will close. Now, I want the parent page (the page which had my links) to reload automatically once the pop-up is closed.

How do I do it?

What I have been doing is::

-- have a function like this:




Thanks.......
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this should do it I think...

window.opener.reload();

or simply

window.opener.location.replace=window.opener.location.href;

Eric
 
Anand Jayaraman
Ranch Hand
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric!

I guess you've got me wrong here. When I cause the pop-up window to close, I must force the parent page to reload. And thus, in the pop-up window, I have included that code.

I tried windo.location.reload(), but what it does is, it reloads the pop-up window before closing it.


Cheers
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first time I looked at your code I did not see the main problem. You are closing the window before you call the reload function. You must call the reload function, then close the pop up window. If you close the window then the reload statement will not be called.

This should do it...
window.opener.reload();
window.close();

Eric
 
Anand Jayaraman
Ranch Hand
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric!

Thanks for that!!! It worked..... Good on you, mate!


Cheers
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are lucky I am up working on my book and not sleeping!

glad it worked....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic