Reload main page after info entered into newly opened window

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
voltrader
Forum Contributor
Posts: 223
Joined: Wed Jul 07, 2004 12:44 pm
Location: SF Bay Area

Reload main page after info entered into newly opened window

Post by voltrader »

I have a main page which displays some information.

User can enter more information by clicking on link, which opens a new window. When user is finished entering data, the window is closed.

How do I reload the main page to reflect the updated information upon close of the newly opened window?

I've found javascript that reloads current page, but I haven't found anything that reloads a page in another window.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

onunload, or during the submit, you could set a timer to do it.
RadixDev
Forum Commoner
Posts: 66
Joined: Sun Mar 14, 2004 11:27 am
Location: U.K.

Post by RadixDev »

According to my source this only works in Netscape...
But here you go anyway:

Main Window:

Code: Select all

<script>
function winopen() &#123;
window.open("whateva.html"."SWindow","");
&#125;
</script>
From the opened page:

Code: Select all

<script>
function RefereshPage()&#123;
  opener.location.href='the url of the main page';
&#125;
</script>
Since it only works in NN it's not much good, how about using frames?
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

Put this in the window that is closing. It will refresh the original window.

Code: Select all

<script>onload=function()&#123;opener.location.reload(true);self.close()&#125;</script>
RadixDev
Forum Commoner
Posts: 66
Joined: Sun Mar 14, 2004 11:27 am
Location: U.K.

Post by RadixDev »

But as I said that only works with Gecko engines.
RadixDev
Forum Commoner
Posts: 66
Joined: Sun Mar 14, 2004 11:27 am
Location: U.K.

Post by RadixDev »

[WRONG POST] SORRY!
Last edited by RadixDev on Thu Aug 26, 2004 10:46 am, edited 1 time in total.
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

The code that I posted is a technique I use on more than one website.
I have tested it and found it to work in IE 5+, Firefox, Netscape, and Opera.
RadixDev
Forum Commoner
Posts: 66
Joined: Sun Mar 14, 2004 11:27 am
Location: U.K.

Post by RadixDev »

OK... I had it wrong :oops

P.S.2 posts before, i posted inthe wrong topic sorry
Post Reply