I'm using jQuery ajax event 'load':
markup code:
<iframe id="my_iframe" src="http://somewhere"></iframe>
jQuery code:
$(function() {
$('#my_frame').load(function(statusCode) {
// The content loaded here maybe 404/500 or other.
if(statusCode == 400) {
// do something.
} else {
// do something else.
}
});
});
Question
I want to get the status code in my load event callback. Maybe get the jqXHR
object to achieve?
Is this possible?
More, I may manually change the src attribute of the iframe, which will also trigger the load
event, it seems this is not an ajax call.