Progress indicator on an iframe submission form to display the progress of the load in a browser other than IE, that is, do not use document.readyState

I have a forms control on my html page, with a target set to the name of another hidden iframe on the page.

When I do a form.submit via a post call, I wish to show a busy/progress indicator until I receive a response from the post request within the iframe.

I tried using document.getElementById("iframename").readyState in IE and it works like a treat, but how do I handle such a scenario in Chrome/Firefox/Safari etc...?

My understanding is that the readyState is not available in other browsers for the html elements including the iframe, except for IE.

Any suggestions would be greatly appreciated.

Thanks.


SInce you tagged jQuery I assume it’s OK to use.

I have had some pretty good results using the .load() listener, like this:

$('#myframe').load(function() {
    // loaded iframe
});