Merge branch 'ent-9765-connection-check-comprueba-conexion-internet-del-navegador' into 'develop'

Ent 9765 connection check comprueba conexion internet del navegador

See merge request artica/pandorafms!5254
This commit is contained in:
Daniel Rodriguez 2022-11-08 11:45:42 +00:00
commit 3423cddfd6
1 changed files with 17 additions and 24 deletions

View File

@ -35,33 +35,26 @@ function handleConnection() {
return;
}
if (navigator.onLine) {
$.ajax({
url: homeurl + "include/connection_check.php",
type: "post",
dataType: "json"
$.ajax({
url: homeurl + "include/connection_check.php",
type: "post",
dataType: "json"
})
.done(function(response) {
connected = true;
showConnectionMessage(connected, msg);
})
.done(function(response) {
.fail(function(err) {
// If test connection file is not found, do not show message.
if (err.status != 404) {
connected = false;
msg = err;
} else {
connected = true;
showConnectionMessage(connected, msg);
})
.fail(function(err) {
// If test connection file is not found, do not show message.
if (err.status != 404) {
connected = false;
msg = err;
} else {
connected = true;
}
}
showConnectionMessage(connected, msg);
});
} else {
// handle offline status
connected = false;
msg = "Connection offline";
showConnectionMessage(connected, msg);
}
showConnectionMessage(connected, msg);
});
}
/**