This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Problem with pop-up

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.......
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric!

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


Cheers
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are lucky I am up working on my book and not sleeping!

glad it worked....
 
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic