homepage Welcome to WebmasterWorld Guest from 54.205.119.163
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Js: refresh main window from child window
how to?
transistor




msg:1471890
 10:52 pm on Nov 11, 2002 (gmt 0)

Hi everyone,
do you know how to refresh a window from a child window?
This is, you are in the main window and you click a button that opens another window, in this case, a login window. After submitting your data and successful login, that window should refresh the main window with personalized content.
I currently use:
window.opener.history.go(0)
which works fine with most browsers except for IE 6.0 for Windows.

Is there a command that does this and work for all browsers or should I have to use different commands for different browsers?

 

korkus2000




msg:1471891
 4:20 pm on Nov 19, 2002 (gmt 0)

Anyone know how to do this?

txbakers




msg:1471892
 4:26 pm on Nov 19, 2002 (gmt 0)

Yes, this is easy. You can use this little bit of code:

opener.location.reload();

This will force the parent window to refresh. Usually I follow that code with this:

window.close();

So the user can click the "close" button and have the main window reload.

this works when the user clicks the "close" button, but if they just click the "X" it doesn't. You can use the onUnload="opener.location.reload()" routine in the <BODY> to catch that one.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved