By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,459 Members | 1,210 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,459 IT Pros & Developers. It's quick & easy.

Problem reloading parent window

P: n/a
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

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


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;
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

P: n/a
Thanks Martin, your solution works perfectly.

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.