I have an strange behavior of this synchronous ajax call when having a weak wlan internet connection on my tablet.
If connection is fine, I'll get "ok", if the connection is lost, I'll get "fail", but if the connection is lost during the request I'll get nothing at all.
My guess is, that the request was sent within the timeout, but while retrieving the data from the ajax call the internet connection broke down and so neither done nor fail will be fired. Do you have any ideas what kind of problem may occur? The best solution should be, that it fires "fail" when connection gets los during the request.
$.ajax({
url: "/callme.php',
type: "GET",
async: false,
timeout: 3000
})
.done(function(data) {
alert("ok");
})
.fail(function(data) {
alert("fail");
});
EDIT: Not, this is not a duplicate question... the timeout doesn't work as expected when you have a weak connection with temporary internet loses.