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

Refreshing a parent window

P: n/a
Hello.

I have a two-framed window in which JavaScript in the right-hand frame
spawns a child window, like this:

function openEditWindow(id)

{

var url = "http://db2/acct/presentation/editCurrency.php?rowToEdit=" + id;

var newWindow = window.open(url, "child", "HEIGHT=200,WIDTH=600");

}

Simple enough. That page contains a form.

When the user submits the form, it is directed to a PHP script that does
various work. It (the PHP script) then redirects the window to a URL
containing this document:

<HTML>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">

function reloadAndClose()

{

opener.location.reload();

window.close();

}

</SCRIPT>

</HEAD>

<BODY onLoad="reloadAndClose()">

<H1>Succeeded.</H1>

</BODY>
</HTML>
While window.close() works, opener.location.reload() does not. I get an
error referring to that line and saying "Permission Denied." This is in the
JavaScript error window.

I am running this in Internet Explorer 6.

Any advice on what I'm doing wrong? Does the PHP redirection void
window.opener?

Thanks.

Best,
Dave
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
us****@davidwall.com writes:
I have a two-framed window in which JavaScript in the right-hand frame
spawns a child window, like this: .... var url = "http://db2/acct/presentation/editCurrency.php?rowToEdit=" + id;
The server name for this HTTP requres is just "db2"? That sounds like
a local server.

While window.close() works, opener.location.reload() does not. I get an
error referring to that line and saying "Permission Denied."


What is the URL used to open the opener window? If the server name is
not just "db2" too, the browser will assume the two pages are on
different domains. You need to make the two domains match in order
to make cross-frame/window scripting work.

If this is for a local application that only needs to run in IE, maybe
you can use a HTTP Application.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
Yes, that was the problem. One page had the IP address, one had the machine
name. A dumb error.

Thank you for your help.

Best,
Dave
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.