I've come across an odd scenario in which window.open() is not triggering the 'load' event if the actual window is already on the screen.
Synopsis
I have a button that when clicked runs some javascript and opens a page in a new window. Standard code that any JS developer has seen. When the method (part of a larger class) is called, it checks if it has a reference to the window (this.preview_window). If so, it will run this.up, it will try and open it again. Once it is open, it runs an update method on that window.
Problem
If the window does not exist, everything runs as expected. If the window does exist but the class doesn't have a reference to it, then the reference is successfully acquired with window.open(), however the update function doesn't get called.
Relevant Code
// This code is run whenever there is no reference to the window
this.preview_window = window.open('/folder/page.php','page_previewer');
Event.observe(this.preview_window, 'load',this.update.bindAsEventListener(this));
The rest of the code has been tested heavily so I'm fairly confident that I'm missing something in how the load event works. The window.open() and update() functions operate as expected in all cases but this one.