views:

143

answers:

1

I have a pop-up window from an exiting application that I want to trap inside a lightbox using an iframe. This is working well except for one thing.

When the pop-up is "done", it calls Window.Opener to reload the parent window. I want to override this so that I can do something else when it attempts to call this function.

I'd prefer to override this vs. modify the pop-up's code, making changes to the existing application is...no fun :)

+1  A: 

Open an intermediate window and call the pop-up from there. The intermediate window is now the "opener", so it will leave the actual parent window alone.

Diodeus
var tempWin = window.open('javascript:void(window.open("","path-to/subwindow.html"));','temp');tempWin.close();
Tracker1
or something to that effect.
Tracker1
Interesting, but if I follow then the Window.Opener call will just be nullified; I want to fire something else when it comes through.Let me know if I'm missing something, thanks!
jasongullickson
In the intermediate window, set window.name (using JavaScript) to an known value. When it reloads, check to see if the value has been set (I won't be on the initial load, but will be one the reload). Based on this, branch to whatever handler function you want for the reload.
Diodeus