diff options
Diffstat (limited to 'Static/Js/message.js')
| -rw-r--r-- | Static/Js/message.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Static/Js/message.js b/Static/Js/message.js index 0c09120..ed5d846 100644 --- a/Static/Js/message.js +++ b/Static/Js/message.js @@ -11,7 +11,7 @@ // **************************************************************************** function start_timer(page) { let seconds = 2; - let text = document.getElementById("redirect").innerHTML; + let text = document.getElementById("redirect").innerHTML; setInterval(() => { if (seconds > 0) { document.getElementById("redirect").innerHTML = text + seconds + " ."; @@ -23,3 +23,12 @@ function start_timer(page) { }, 1000); } + + +// On essaie de récupérer la division pour rediriger avec un timer +let rTimer = document.getElementById("rTimer"); + +// Si elle existe on redirige vers la page indiquée +if (rTimer) { + start_timer(rTimer.getAttribute("data-page")); +} |
