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

C

cgrady

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?
 
R

Randy Webb

(e-mail address removed) 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?
 
C

cgrady

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.
"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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top