Exception instead of failCallback on Chrome when server offline
Enviroment: $.fileDownload v1.4.1, Chrome 27.0.1453.116. code:
$.fileDownload(url, {
data: data,
httpMethod: type,
successCallback: function () {
},
failCallback: function (response) {
}
});
If the server which url was specified is inaccessible (for example turn off local IIS/Apache) then the plugin will be infinitely waiting for a response and filling the browser's console with tons of errors: "Blocked a frame with origin 'http://localhost' from accessing a frame with origin 'null'. The frame requesting access has a protocol of "http", the frame being accessed has a protocol of 'data'. Protocols must match."
I believe that the reason of such behavior is this WebKit's bug: https://code.google.com/p/chromium/issues/detail?id=17325
I actually reproduce this bug even if the server is online but reply an error, for example 400 (bad request) or 404 (not found).
This error occurs only when the httpMethod is set to 'POST'.