I am attempting to submit a form to an external site which is prepared to receive it, but there were some points when the external site was done and caused my site to be stuck waiting with no response just using form.submit()
I wrote the following to try to handle this, but the timeout is not being thrown.
$.ajax({
async: false,
url: url,
data: $('#tppForm').serialize(),
type: 'POST',
timeout: 5000,
statusCode: {
404: function() {
console.log('Site Not Found');
},
500: function() {
console.log('Site Down');
}
},
error: function() {
console.log('Timeout');
}
});