Refreshing a parent window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • usenet@davidwall.com

    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.ph p?rowToEdit=" + id;

    var newWindow = window.open(url , "child", "HEIGHT=200,WID TH=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="JavaS cript">

    function reloadAndClose( )

    {

    opener.location .reload();

    window.close();

    }

    </SCRIPT>

    </HEAD>

    <BODY onLoad="reloadA ndClose()">

    <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
  • Lasse Reichstein Nielsen

    #2
    Re: Refreshing a parent window

    usenet@davidwal l.com writes:
    [color=blue]
    > I have a two-framed window in which JavaScript in the right-hand frame
    > spawns a child window, like this:[/color]
    ....[color=blue]
    > var url = "http://db2/acct/presentation/editCurrency.ph p?rowToEdit=" + id;[/color]

    The server name for this HTTP requres is just "db2"? That sounds like
    a local server.

    [color=blue]
    > While window.close() works, opener.location .reload() does not. I get an
    > error referring to that line and saying "Permission Denied."[/color]

    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 - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • usenet@davidwall.com

      #3
      Re: Refreshing a parent window

      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

      Comment

      Working...