SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: refreshing

  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    refreshing

    is it possible to refresh a parent window from the child one?

  2. #2
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, you need an event in your popup window to fire the function, but this is the line you need:

    window.opener.reload();

  3. #3
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how could I do it so when they close the window it refreshes it?

  4. #4
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know this works with IE but I don't know what support is like for other browsers:

    <head>
    <script language="javascript">
    function refreshParent() {
    parent.opener.reload(); //refreshes parent window
    window.close(); //closes popup window
    }
    </script>
    </head>
    <body>
    <form name="elForm" action="" method="">
    <input type="button" name="btnClose" value="Close Popup Window" onClick="refreshParent();" />
    </form>
    </body>

    i don't know what you're doing with your popup window, but this function and something to fire it needs to be in there. i used a button with an onclick event, but you can attatch this function to whatever you want

  5. #5
    SitePoint Wizard Mincer's Avatar
    Join Date
    Mar 2001
    Location
    London | UK
    Posts
    1,140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've just tried using these methods but none work, and when I looked at the JavaSCript language reference there is no mention of the reload() method for 'window'.

    EDIT: got it, it's a 'Location' method.

    window.opener.location.reload()
    Last edited by Mincer; Feb 25, 2002 at 05:32.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •