I have a modal dialog which contain form and hidden iframe to which form is submitted. The result of submission is file to download. I need to close modal dialog as soon as download dialog is opened i.e. file is ready. I was trying to catch 'onreadystatechange' event of iframe, but after submit call changing state to 'complete' it does not trigger 'onreadystatechange' event.
Eventually, i use window.setInterval which monitoring readyState of iframe and close modal dialog when its state == 'complete'.
the solution that using window.setInterval seems not professional to me and I am looking for better solution, I saw solution with cookies but I can't use cookies in my application.
Any help will be appreciated!