473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Refreshing a parent window

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
2 5659
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jamie Jackson | last post by:
The crux of the problem is I only know if the popup *has been* opened, but not if it *is* open. Therefore, the script doesn't know whether to simply refocus, or whether to popup a fresh window. ...
1
by: Vijay Kumar | last post by:
Hello all I have a window (call it the parent window) that when moved makes any children windows (windows that were opened by this window) move by the same distance in X & Y direction. I do this...
4
by: Sileesh | last post by:
Hi I have a btn in Parent.aspx page . On server_click() of the Btn, i am opening a new window called the child.apsx window. Child window also have a Btn. On serverClick of this Btn, I perform...
1
by: hashya | last post by:
Hi, I am opening window(child) from current window(parent). Now I want to keep refreshing child window from parent window. How can I achieve this. e.g. var win =...
13
by: honey99 | last post by:
Hi! I have to fix a problem in JSP.Actually,i have a JSP page say Ex1.jsp.In this Ex1.jsp i have an anchor tag which links into another JSP page i.e when i click on the link another pop-up window...
4
by: Buddha | last post by:
Hello, I posted this on two forums, without too much help .. and I am kinda stuck in this. I need to refresh the parent page from the second child window which is opened by the first child and...
3
by: gsuns82 | last post by:
Hi all, I am using modal window for some update purpose, the issue i am facing is,i am not able to refresh parent after closing modal window. The code i used: ...
0
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in...
1
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in...
4
by: Ria12 | last post by:
hi... I have grid in my Parent page on clik of gridview Edit column it open a Popup window fill all records for updation.But I have problem when user update a record popup window is not...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.