0
こんにちは私は、タイムアウトが1000に設定されている場合、この値を5000に変更すると動作します。たとえば、無視され、エラーイベントは発生しません。ajaxタイムアウトは1秒間だけ有効
$.ajax({
method: 'GET',
url: raspberry_url+'/stop_training',
contentType: "application/json; charset=utf-8",
processData: false,
dataType: 'json',
headers: {"Authorization": "Bearer "+localStorage.getItem('token')},
complete: function(data) {
localStorage.setItem('SmartSailing',true);
data = JSON.stringify(data.responseJSON);
data = JSON.parse(data);
if (data.status == '200'){
localStorage.setItem('token',data.new_token);
}else{
mui.viewport.showPage("try-again-page", "FADE");
}
},
timeout: 5000,
error: function(jqXHR, textStatus, errorThrown) {
localStorage.setItem('SmartSailing',false);
if(textStatus==="timeout") {
swal({
title: "Connection Failed!",
text: "Please check your connection to the SmartSailing network",
confirmButtonColor: "#DD6B55",
confirmButtonText: "OK",
closeOnConfirm: true,
});
}
}
});
この質問に対する関連はありますか? http://stackoverflow.com/questions/42099457/ajax-timeout-not-working –