Author: Morpheus (alias djgalix)
Description: The TimePage BBCode display an alert box when you leave this page
[valid][/valid]
BBCode:
Code: Select all
[timepage][/timepage]
Code: Select all
<script type="text/javascript">
NavName = navigator.appName.substring(0,3);
NavVersion = navigator.appVersion.substring(0,1);
if (NavName != "Mic" || NavVersion>=4)
{
entree = new Date;
entree = entree.getTime();
}
function esortTemp()
{
if (NavName != "Mic" || NavVersion>=4)
{
sortie = new Date;
sortie = sortie.getTime();
secondes = Math.floor((sortie-entree)/1000);
minutes = Math.floor(secondes/60);
while (secondes>=60)
{
secondes = secondes-60;
}
alert('You were connected ' + minutes + ' minute(s) and ' + secondes + ' seconde(s) on this page!') }
}
window.onunload = esortTemp
</script>
Code: Select all
Timepage: [timepage][/timepage]
Code: Select all
[timepage][/timepage]
[timepage][/timepage]
(you will see when you leave this page)