When is popped up window done rendering?

Discussion in 'Javascript' started by Christopher Benson-Manica, Apr 7, 2004.

  1. I have a situation where a bit of script needs to pop up another
    window, and then call a script in that new window. My conundrum is
    that the script should not be called until the new window has rendered
    completely. What's the best way for the new window to tell its opener
    that it is fully rendered? The thought that occurs to me is having a
    script at the bottom of the new window that calls a script in the
    openening window that then calls the "real" script in the new window.
    The obvious solution (having the new window just call the script
    itself) isn't feasible because the opener has the information that the
    new window's script needs. Is there a better way to do this? I
    apologize if I've explained my situation poorly.

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
    Christopher Benson-Manica, Apr 7, 2004
    #1
    1. Advertising

  2. It doesn't truly matter where the script goes. If you want to be sure it
    doesn't run until the window has fully loaded its code, put your script at
    the end

    - Wm


    --
    William Morris
    Semster, Seamlyne reProductions
    Visit our website, http://www.seamlyne.com, for the most comfortable
    historically inspired clothing you can buy!

    "Christopher Benson-Manica" <> wrote in message
    news:c512c4$379$...
    > I have a situation where a bit of script needs to pop up another
    > window, and then call a script in that new window. My conundrum is
    > that the script should not be called until the new window has rendered
    > completely. What's the best way for the new window to tell its opener
    > that it is fully rendered? The thought that occurs to me is having a
    > script at the bottom of the new window that calls a script in the
    > openening window that then calls the "real" script in the new window.
    > The obvious solution (having the new window just call the script
    > itself) isn't feasible because the opener has the information that the
    > new window's script needs. Is there a better way to do this? I
    > apologize if I've explained my situation poorly.
    >
    > --
    > Christopher Benson-Manica | I *should* know what I'm talking about - if I
    > ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
    William Morris, Apr 7, 2004
    #2
    1. Advertising

  3. Christopher Benson-Manica

    Randy Webb Guest

    Christopher Benson-Manica wrote:

    > I have a situation where a bit of script needs to pop up another
    > window, and then call a script in that new window. My conundrum is
    > that the script should not be called until the new window has rendered
    > completely. What's the best way for the new window to tell its opener
    > that it is fully rendered? The thought that occurs to me is having a
    > script at the bottom of the new window that calls a script in the
    > openening window that then calls the "real" script in the new window.
    > The obvious solution (having the new window just call the script
    > itself) isn't feasible because the opener has the information that the
    > new window's script needs. Is there a better way to do this? I
    > apologize if I've explained my situation poorly.
    >


    page1 opens page2
    page1 wants to call a function in page2
    page1 needs to know when page2 gets loaded.

    page1:

    window.open('page2.html')

    page2:
    function iAmLoaded(){
    window.opener.functionNameInPage1YouWantToRun();
    }
    window.onload = iAmLoaded;

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/
    Randy Webb, Apr 7, 2004
    #3
  4. Christopher Benson-Manica

    Nathan Sweet Guest

    In the new window that opens:

    <script>
    window.onload = function () {
    var neededInfo = window.opener.getInfoForNewWindow();
    // Use info gotten from parent window here.
    }
    </script>

    Or let the parent window know when the new window is ready:

    <script>
    window.onload = function () {
    window.opener.newWindowIsOpen();
    }
    </script>

    Or you could actually check the status of the new window from the
    parent window, but this is going to be more browser specific.

    -Nate

    Christopher Benson-Manica <> wrote in message news:<c512c4$379$>...
    > I have a situation where a bit of script needs to pop up another
    > window, and then call a script in that new window. My conundrum is
    > that the script should not be called until the new window has rendered
    > completely. What's the best way for the new window to tell its opener
    > that it is fully rendered? The thought that occurs to me is having a
    > script at the bottom of the new window that calls a script in the
    > openening window that then calls the "real" script in the new window.
    > The obvious solution (having the new window just call the script
    > itself) isn't feasible because the opener has the information that the
    > new window's script needs. Is there a better way to do this? I
    > apologize if I've explained my situation poorly.
    Nathan Sweet, Apr 7, 2004
    #4
    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. Earl Teigrob
    Replies:
    4
    Views:
    1,165
    Vidar Petursson
    Jun 5, 2004
  2. Peter Mount
    Replies:
    4
    Views:
    928
    Peter Mount
    Jan 31, 2006
  3. Simon Wigzell

    Popped up window not resizeable as defined

    Simon Wigzell, Jul 22, 2003, in forum: Javascript
    Replies:
    1
    Views:
    75
    Simon Wigzell
    Jul 22, 2003
  4. Zhidian Du
    Replies:
    0
    Views:
    138
    Zhidian Du
    Feb 21, 2004
  5. textarea in a popped window

    , Oct 20, 2005, in forum: Javascript
    Replies:
    3
    Views:
    93
    Randy Webb
    Oct 20, 2005
Loading...

Share This Page