Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    47
    Thanks
    5
    Thanked 1 Time in 1 Post

    Need to refresh a window by specified name

    I have a window, named using the following script at the top:
    <script language='javascript'>window.name='Window1';</script>

    I need to call a reload on this window from another window. I'm sure it would be a derivative of the following:
    <script language='javascript'>window.parent.location.reload();</script>

    Window1 is NOT the parent window of the other window that will reload it.

    Help?

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    If Window1 is not related to the window that will reload it, the only thing I think that will get the window handle of Window1 is to open a blank window with that same name. Just make sure both windows are in the same domain.

    Code:
    function reloadWin(){
      var w=window.open("", "Window1"); //get handle of Window1
      alert(w.location.href); //check URL - test only
      w.location.reload(true);  //reload it
    }

  • #3
    New Coder
    Join Date
    May 2007
    Posts
    47
    Thanks
    5
    Thanked 1 Time in 1 Post

    Thumbs up

    Quote Originally Posted by glenngv View Post
    If Window1 is not related to the window that will reload it, the only thing I think that will get the window handle of Window1 is to open a blank window with that same name. Just make sure both windows are in the same domain.

    Code:
    function reloadWin(){
      var w=window.open("", "Window1"); //get handle of Window1
      alert(w.location.href); //check URL - test only
      w.location.reload(true);  //reload it
    }
    That was perfect, exactly what I needed! Thank you.


  •  

    Posting Permissions

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