Close window with target?

Discussion in 'Javascript' started by Targa, Jun 18, 2004.

  1. Targa

    Targa Guest

    How can I set a target for this script? It launches from an Iframe and I
    need the parent page to refresh when it closes

    <!-- Go to Invoice and Close Popup Window-->
    <script language="JavaScript"><!--
    function supressError() {
    return true;
    }

    function load(url) {
    window.onerror = supressError;
    opener.location.href = url;
    setTimeout('self.close()',100);
    }
    //--></script>

    Thanks!
     
    Targa, Jun 18, 2004
    #1
    1. Advertising

  2. > How can I set a target for this script? It launches from an Iframe and I
    > need the parent page to refresh when it closes


    I don't really know what you are looking for, but maybe this can help
    you:

    The parent of an IFRAME is window.parent, the opener of a popup window
    is 'window.opener' So, the document in which the IFRAME is embedded
    should be refereable from the popup window by opener.parent.

    Good luck,
    Vincent
     
    Vincent van Beveren, Jun 18, 2004
    #2
    1. Advertising

  3. Targa

    Targa Guest

    That did it - Thanks!



    "Vincent van Beveren" <> wrote in message
    news:40d29af7$0$36169$4all.nl...
    > > How can I set a target for this script? It launches from an Iframe and I
    > > need the parent page to refresh when it closes

    >
    > I don't really know what you are looking for, but maybe this can help
    > you:
    >
    > The parent of an IFRAME is window.parent, the opener of a popup window
    > is 'window.opener' So, the document in which the IFRAME is embedded
    > should be refereable from the popup window by opener.parent.
    >
    > Good luck,
    > Vincent
    >
    >
     
    Targa, Jun 18, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    6
    Views:
    8,881
    sateeshranga
    Aug 7, 2008
  2. Iñaki Baz Castillo
    Replies:
    7
    Views:
    898
    Iñaki Baz Castillo
    Jan 12, 2010
  3. Walter Beierdonck

    Self.close() window without the dialog close?Yes/NO

    Walter Beierdonck, Apr 29, 2004, in forum: Javascript
    Replies:
    1
    Views:
    358
    Grant Wagner
    Apr 30, 2004
  4. Replies:
    3
    Views:
    426
    Chung Leong
    Jan 16, 2005
  5. Shang Wenbin

    close current window using window.close()

    Shang Wenbin, Sep 1, 2005, in forum: Javascript
    Replies:
    10
    Views:
    399
    Gérard Talbot
    Sep 2, 2005
Loading...

Share This Page