Last active
October 23, 2019 03:49
-
-
Save parzibyte/64b85c63f344b1078175ae2cca3379ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
?><!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Mi página web</title> | |
</head> | |
<body> | |
<p>Aquí el usuario puede tardar lo que quiera, su sesión no se va a | |
cerrar por inactividad</p> | |
<script> | |
document.addEventListener("DOMContentLoaded", function(){ | |
// Invocamos cada 5 segundos ;) | |
const milisegundos = 5 *1000; | |
setInterval(function(){ | |
// No esperamos la respuesta de la petición porque no nos importa | |
fetch("./refrescar.php"); | |
},milisegundos); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment