www.webdeveloper.com
Results 1 to 4 of 4

Thread: window.opener.location

  1. #1
    Join Date
    Nov 2011
    Posts
    2

    window.opener.location

    Hi people,

    I'm using window.showModalDialog but having an issue trying to set the parent window(main browser).

    I open modal window A which is then opens modal window B, top of modal window B onload I do window.opener.close()". My issue now is when i'm finished with B I set parent window(main browser) to a new url with window.opener.location. So my problem is modal window A the parent has been closed so window.opener.location will not work. Any ideas what I could do to set the actual parent parents url?

    Sorry bit confusing hope someone under stands.

  2. #2
    Join Date
    Mar 2007
    Location
    U.K.
    Posts
    1,127
    You could try saving parent.parent beforehand, but with the intermediate window reloaded I don't know if it will work.
    Where used, return should be executed unconditionally and always as the last statement in the function.

    That's my signature, it's not part of the damn post!

  3. #3
    Join Date
    Nov 2011
    Posts
    2
    Thanks for you reply, not quite sure what you mean by saving parent.parent though.

  4. #4
    Join Date
    Mar 2007
    Location
    U.K.
    Posts
    1,127
    Quote Originally Posted by dclarke View Post
    Thanks for you reply, not quite sure what you mean by saving parent.parent though.
    Something like this maybe, but I wouldn't guarantee it:
    Code:
    var w = parent.parent;
    
    /* whatever you do that refeshes the intermediate window */
    
    w.location.href = myURL;
    Where used, return should be executed unconditionally and always as the last statement in the function.

    That's my signature, it's not part of the damn post!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles