When is popped up window done rendering?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christopher Benson-Manica

    When is popped up window done rendering?

    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)cybers pace.org | don't, I need to know. Flames welcome.
  • William Morris

    #2
    Re: When is popped up window done rendering?

    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!

    "Christophe r Benson-Manica" <ataru@nospam.c yberspace.org> wrote in message
    news:c512c4$379 $1@chessie.cirr .com...[color=blue]
    > 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)cybers pace.org | don't, I need to know. Flames welcome.[/color]


    Comment

    • Randy Webb

      #3
      Re: When is popped up window done rendering?

      Christopher Benson-Manica wrote:
      [color=blue]
      > 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.
      >[/color]

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

      page1:

      window.open('pa ge2.html')

      page2:
      function iAmLoaded(){
      window.opener.f unctionNameInPa ge1YouWantToRun ();
      }
      window.onload = iAmLoaded;

      --
      Randy
      Chance Favors The Prepared Mind
      comp.lang.javas cript FAQ - http://jibbering.com/faq/

      Comment

      • Nathan Sweet

        #4
        Re: When is popped up window done rendering?

        In the new window that opens:

        <script>
        window.onload = function () {
        var neededInfo = window.opener.g etInfoForNewWin dow();
        // 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.n ewWindowIsOpen( );
        }
        </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 <ataru@nospam.c yberspace.org> wrote in message news:<c512c4$37 9$1@chessie.cir r.com>...[color=blue]
        > 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.[/color]

        Comment

        Working...