Adding notify JS to alert if connexion to APIs is lost.

This commit is contained in:
nriault
2019-04-18 14:09:54 +02:00
parent 7434d7da6f
commit 0d8f112c9e
6 changed files with 41 additions and 10 deletions

View File

@ -31,7 +31,8 @@ function showKarts() {
});
},
error: function (xhr) {
alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);
$.notify("APIs unreachable!", "error");
console.log('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);
},
});
}
@ -54,7 +55,8 @@ function getKartsMenu() {
});
},
error: function (xhr) {
alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);
$.notify("APIs unreachable!", "error");
console.log('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);
},
});
}
@ -129,7 +131,8 @@ function getPilotsByKart() {
});
},
error: function (xhr) {
alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);
$.notify("APIs unreachable!", "error");
console.log('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);
},
});
}