Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

First post here. I have a problem I CANNOT solve. I have a popup window (window.open). Let's say that opens "1.php". It has a form that submits to "2.php" after a button whose Id is "Submit" is clicked.

It is easy to add an Onload function toa popup:

open_window = window.open("1.php", "",'width=100,height=100,location=0');   
open_window.addEventListener("load", function(){//do something}, false);

But I WANT something different. I want this:

open_window = window.open("1.php", "",'width=100,height=100,location=0');

// a lot of thing happen. then after certain action, another function does this:

open_window.document.getElementById("Submit").click(); //submits to "2.php"


open_window.addEventListener("load", function(){//DO SOMETHING AFTER 2.PHP HAS LOADED}, false);

This last command does not work. I have 1.php that is already loaded. then submit the form to 2.php and insert an OnLoad to 2.php. The form DOES submit but onload does not execute.

Any ideas? i tried the equivalent with iframe and it works

I appreciate any help.

Danny

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.