Is there a way to execute a javascript function on the second load of an iframe? Right now I am nesting two addEventListeners:
document.getElementById('my_iframe').addEventListener("load", function() {
document.getElementById('my_iframe').addEventListener("load", doSomething(), true);
}, true);
The first "load" is triggered when I use document.my_iframe.write('...'). I want to trigger an action after I submit a form in the iframe, which is the second "load".
Is there a better way to accomplish my goal?