Web Hosting Talk







View Full Version : Javascript How to Refresh another Page ?


eddy2099
08-18-2003, 02:44 AM
Currently, I am building a database management module and on one screen (Page A), it shows a Grid of all records, each time someone clicks on a record/row, it will open up a new page (Page B) which has all the details of that record and allow them to make whatever necessary changes to the record.

The problem is after the record is updated, I want to be able to update the master report (Page A). How do I do that in Javascript ?

I know that if I do a :

windows.location.reload()

it refreshin the current page. How do I send cause Page A to refresh from Page B ?

Thanks.

digitok
08-18-2003, 03:06 AM
Well, I don't know how you want it to refresh (by a link, or something?)...

Anyway, if you want a link on page B to refresh page A, you can do this:


<a href="javascript:opener.location.reload();">Reload Page A</a>


Hope it helps...

eddy2099
08-18-2003, 03:09 AM
Yup, by a link would be nice since there are some updating need to be done prior to that happening. I would take it that 'pener' is the name of the first page.

Thanks. I will give it a try.

digitok
08-18-2003, 03:12 AM
Okay, I had to keep editing it because vB was changing everything...

It's 'opener' (being the page that opened that page) and take the space out of 'java script'...

I was hoping you wouldn't see it until I finished editing it, but oh well :P

eddy2099
08-18-2003, 03:23 AM
Haa haa. Thanks. Now that works :) I owe you one..

Definitely need to get a Javascript guide once this job is done.

LindonNetworks
08-19-2003, 03:57 AM
Use frames and then:

window.framename.reload();

Romanticus
08-19-2003, 02:13 PM
also:
top.frames['frame_name'].location.reload
or
top.frames['frame_name'].navigate('URI_to_page');

eddy2099
08-19-2003, 06:38 PM
Thanks but I cannot use frames since the second page as to pop out as a separate windows due to the space constraint and also that I do not want to remove the information from the first page.