Here is the downloadURL
function which I'm using to download a file:
function downloadURL(url) {
var hiddenIFrameID = 'hiddenDownloader',
iframe = document.getElementById(hiddenIFrameID);
if (iframe === null) {
iframe = document.createElement('iframe');
iframe.id = hiddenIFrameID;
iframe.style.display = 'none';
document.body.appendChild(iframe);
}
iframe.src = url;
};
This can work perfectly for downloading a file, but right now, I want to get the return http status code, if the http status code is not 200, I'd like to alert
something out.
Could anyone tell me how to retrieve that? Thanks in advance.