At some point I change an iframe src in order to download a file:
document.getElementById('download_frame').src = "file.zip";
I need some kind of callback to execute when the iframe has completely reloaded (in this case when the file is completely downloaded). I tried:
<iframe id="download_frame" style="display: none;" onload="console.log('load1');">
    <script>
        document.addEventListener("DOMContentLoaded", function(event) {
            console.log('load2');
        });
    </script>
</iframe>
but they are never fired...
Any suggestion?
 
     
    