Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

close child Window and reload parent window

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i have a parent window where a button is pressed to create a child window. In the child window i can edit and save the record. Now when i press the "Close" button(in the Child Window), i want to close the child Window and reload the parent window so it can show the latest changes.

i tried :
parent.document.location.reload();
window.close();

but it does not seem to work.

Any Suggestions


Thanks

Anil
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
define a function in the parent window called close child or some such, close the child then call reload on self. Hope this helps
 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

But i tried something else in the child window:

opener.location = "http://name.com";
opener.focus();
self.close();

and it works.

But thanks for your solution


 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I saw that issue in couple cases. From my point of view, you have to have a delay between calling reload and close, something like



My filling is that window gets closed to fast, so reload does not get a chance to start.
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic