Problem reloading parent window

S

Snolly

Hi all,

Here is my issue. I have a web page (lets call it page1) with an
iframe in it that then opens a pop-up window (page2). The pop-up
window is used to edit some data that was loaded into page1 so I want
to use onunload to reload page1 to keep the data synchronized.

At first I was using just

window.opener.parent.location = window.opener.parent.location;

and this worked fine.

Now I want to first set the text of page1, i.e.

window.opener.parent.document.write('Contents Updated...reloading
page');

and then reload it.

So I now have the function:

function reloadInfoPage()
{
window.opener.parent.document.write('Contents
Updated...reloading page');
window.opener.parent.location =
window.opener.parent.location;
}

both lines of code work individually. The problem is that once I run
the first line of code, the second line ceases to function. Any ideas?
Thanks,

Mark
 
M

Martin Honnen

Snolly wrote:

function reloadInfoPage()
{
window.opener.parent.document.write('Contents
Updated...reloading page');
window.opener.parent.location =
window.opener.parent.location;
}

Try
var win = window.opener.parent;
var oldHref = win.location.href;
win.document.open();
win.document.write('Contents ...');
win.document.close();
win.location.href = oldHref;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top