• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to refresh parent window?

Guest
Feb 26, 2009 Feb 26, 2009

Copy link to clipboard

Copied

Howdy,

i open a open child window using window.open.

once stuff is done in child window....user can close it by pressing close button or X on top right.

When they close child window, i want to refresh parent window and show changes from child window in parents window.
How to do this?

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 01, 2009 Mar 01, 2009

Copy link to clipboard

Copied

hi,

That's a javascript issue.

Here are some functions that I usually use for things like that:

function opener_get_element(id) {
var object = null;
object= window.opener.document.getElementById(id);
return object;
}

function opener_set_value(id, value){
if (opener_get_element(id))
opener_get_element(id).value= value;
}
function opener_refresh(formid){
opener_get_element(formid).submit();
}

cheers,
fober

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 01, 2009 Mar 01, 2009

Copy link to clipboard

Copied

google "javascript refresh parent"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 02, 2009 Mar 02, 2009

Copy link to clipboard

Copied

I have the same problem before and used this code and I use onclick event on the close button :

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 02, 2009 Mar 02, 2009

Copy link to clipboard

Copied

quote:

Originally posted by: dchard
I have the same problem before and used this code and I use onclick event on the close button :

What happens if you close the pop-up another way? There are at least 2 that I can think of.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 02, 2009 Mar 02, 2009

Copy link to clipboard

Copied

LATEST
the OPENER object is available in UNLOAD event.
so you can call that js function in the body's onUnload event and just
call self.close() in the button's/link's onClick event...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation