Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Why won't window.onload fire after window.open? - or - Safari and IE, how I loathe thee

Reply
Thread Tools

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

 
 
cgrady@gmail.com
Guest
Posts: n/a
 
      08-10-2006
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?

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      08-10-2006
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/
 
Reply With Quote
 
 
 
 
cgrady@gmail.com
Guest
Posts: n/a
 
      08-11-2006
> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
onload doesn't fire in Safari if src set to same img twice Ross Javascript 2 03-03-2010 02:30 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Loathe to mention this Jono UK VOIP 7 02-06-2006 08:18 AM
PostBack doesn't fire the first time with Safari 1.2.1 Ian Cox ASP .Net 2 06-23-2004 09:52 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57