I am having a problem with onLoad event of an iframe on Google Chrome. I created an iframe and set value for its "src" attribute to get a file from server. While server is processing, a waiting box is displayed until client gets the returned file. I tried to use the onLoad event of iframe to detect when client get the file to turn off that waiting box, but on Google Chrome that event handler does not work.
With Firefox, when client gets a file, a "Save to" popup will be displayed automatically and event "load" will be fired, but this is not happen on Chrome.
Could you please tell me how to handle this issue? Thank you so much!
Google Chrome has a built-in download manager to display all your downloads, whether it's active, failed, canceled, or completed. Press Ctrl + J or click the Options dropdown menu and select Downloads to open the download manager. In the list of downloads, find the failed item and click Resume.
Display Your Chrome Downloads Alternatively, you can use the "My Downloads" keyboard command. Press Ctrl + J (hold down the Ctrl key and the J key at the same time) to accomplish the same result and display the download list.
I've run into this exact issue. It turns out Chrome triggers absolutely no events in an iframe upon a file download.
Since there are no events to look out for and you're returning a file (as apposed to any inline content) the workaround I was forced to inspect the contents of the iframe after a few seconds, if it is empty then assume there were no errors and the results were processed correctly. If it contains data (my server will return JSON if there are any errors) then handle the error data accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With