Why won't window.onload fire after window.open? - or - Safari and IE, how I loathe thee

Discussion in 'Javascript' started by cgrady@gmail.com, Aug 10, 2006.

  1. Guest

    I'm working on part of a larger project, and in trying to debug one
    aspect, I've got a small test file to work with.

    The code is practically identical (all important aspects match word for
    word) to the larger project, which works fine in IE and Firefox so far,
    but my little test fails in IE, and I cannot figure out why.

    http://geekforhire.org/tests/window_open_onload.html

    It's supposed to open the window, change the background color, and add
    a word to the body.

    In IE, it never makes it to the callback function, as if the onload
    isn't firing. Is there some quirk of events I'm unaware of?

    It should be noted that the code also fails in Safari, but I expected
    that as the original project fails in Safari as well (this all started
    in an attempt to find a working solution for Safari as well).

    So basically, how can I make it fire the onload for all 3 browsers?
     
    , Aug 10, 2006
    #1
    1. Advertising

  2. Randy Webb Guest

    Re: Why won't window.onload fire after window.open? - or - Safariand IE, how I loathe thee

    said the following on 8/10/2006 3:02 PM:
    > I'm working on part of a larger project, and in trying to debug one
    > aspect, I've got a small test file to work with.
    >
    > The code is practically identical (all important aspects match word for
    > word) to the larger project, which works fine in IE and Firefox so far,
    > but my little test fails in IE, and I cannot figure out why.
    >
    > http://geekforhire.org/tests/window_open_onload.html
    > It's supposed to open the window, change the background color, and add
    > a word to the body.



    It opens a new window, turns the background color gray, and adds the
    word "blah" to the body in IE7.

    But, your code has more problems than just that.

    > So basically, how can I make it fire the onload for all 3 browsers?


    "all 3 browsers"? Would that be Konqueror, K-Meleon and Opera? Or would
    it be ICEBrowser, Pythia and Amaya?


    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Aug 10, 2006
    #2
    1. Advertising

  3. Guest

    > It opens a new window, turns the background color gray, and adds the
    > word "blah" to the body in IE7.


    I didn't get back here earlier to reply, I found some help elsewhere
    and fixed it. The problem is I had the onload addevent after the
    ..close, which is what triggers the load in Safari and IE.

    > > So basically, how can I make it fire the onload for all 3 browsers?

    >
    > "all 3 browsers"? Would that be Konqueror, K-Meleon and Opera? Or would
    > it be ICEBrowser, Pythia and Amaya?


    Firefox, IE, and Safari, obviously, since those are the 3 I explicitly
    mentioned.

    Ah, the beauty of context.
     
    , Aug 11, 2006
    #3
    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. Kathy Burke
    Replies:
    1
    Views:
    1,152
    Severin
    Nov 10, 2003
  2. Chad
    Replies:
    4
    Views:
    8,424
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,258
    Smokey Grindel
    Dec 2, 2006
  4. David Otton

    window.onload and body.onload differences

    David Otton, Nov 4, 2004, in forum: Javascript
    Replies:
    2
    Views:
    618
    Martin Honnen
    Nov 4, 2004
  5. Ross
    Replies:
    2
    Views:
    246
Loading...

Share This Page