»
AnglaisFranaisVietnamien

Imprimer - Temps passé sur la page - JavaScriptBank.com

Version complte: jsB@nk » Heure » Temps passé sur la page
URL: http://www.javascriptbank.com/time-spent-on-page.html

Temps passé sur la page © JavaScriptBank.comCet JavaScript affiche une alerte message quand une page est fermée, le visiteur de dire combien de temps (en secondes), ils ont été sur la page. Il peut également afficher la heure sur la page de la titre bar.

Version complte: jsB@nk » Heure » Temps passé sur la page
URL: http://www.javascriptbank.com/time-spent-on-page.html



JavaScript
<script type="text/javascript" name="timePage.js">// Created by: Cody Shaffer :: http://codytheking313.byethost11.comvar time=1;function timeHere() {  time = time + 1;  finalTime = time / 10;/* Remove the "//" below to display in the title bar  the amount of time the visitor has been on the site.  Be aware though, that it does tend to be a bit distracting. */// document.title = finalTime+" seconds you been here for!";}function sayTime() {  finalTime = time / 10;  alert("Thank you for coming to my site! \n You have been here " + finalTime + " seconds!");}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<body onload='window.setInterval("timeHere()", 100)' onunload="sayTime()"><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->