Welcome to WebmasterWorld Guest from 54.146.233.30

Forum Moderators: open

Message Too Old, No Replies

Js: refresh main window from child window

how to?

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

Junior Member

10+ Year Member

joined:May 2, 2002
posts:141
votes: 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?

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

Senior Member

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 20, 2002
posts:3732
votes: 0


Anyone know how to do this?
4:26 pm on Nov 19, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
posts:4392
votes: 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.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members