473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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 '06 #1
2 2701
cg****@gmail.com 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/
Aug 10 '06 #2
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 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
7
by: Tery Griffin | last post by:
Hi all, Iıve been away from Javascript for awhile and am rusty, but this is too simple not to work! Iım on a Mac, and usually use the Safari browser. I have a very basic web page in a frame. ...
10
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
2
by: kloppie | last post by:
Hi there, im working on a page which causes me problems - the page contains of a couple of controls where the user can choose some options for a Report. When the user then clicks a button...
2
by: RobG | last post by:
There has been a bit of work done to get an init() function to run when the DOM is complete but before all the images have been downloaded. The idea is to kickoff init() scripts when all the...
20
by: Mark Anderson | last post by:
Hi, I have this in an external JS library: ///////////////////////// function addMyEvent(){ var obj; if(document.attachEvent) { obj = document.getElementsByTagName('img'); for...
1
by: judacris | last post by:
I've seen the threads here about molding 2 divs in a centered fashion. but I can't seem to solve this thing. my blogger blog is functioning well on my site for now, but the blog feed (left) and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.