Welcome to WebmasterWorld Guest from 50.16.112.199

Forum Moderators: open

Js: refresh main window from child window

how to?

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

10+ Year Member



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)

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



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

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



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.

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month