Ja. Begintijd vastleggen als je hem opent. En in de onunload van de popup de eindtijd doorgeven aan het hoofdwindow.
En hierbij de eerste Google Hit: http://www.javascriptguide.com/datetime.html
---
Prozium - The great nepenthe. Opiate of our masses. Glue of our great society. Salve and salvation, it has delivered us from pathos, from sorrow, the deepest chasms of melancholy and hate
HTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| <html> <head> <title>Timer</title> <script type="text/javascript"> function popup() { window.open('popup.html', '', ''); startTimer(); } var startTime; function startTimer() { startTime = new Date().valueOf(); } function endTimer() { var endTime = new Date().valueOf(); var duration = (endTime - startTime) / 1000; alert('duration: '+duration+' seconds'); } </script> </head> <body> <a href="javascript://" onclick="popup()">open popup</a> </body> </html> |
popup.html:
HTML:
1
2
3
4
5
6
7
| <html> <head> <title>Ik ben een popup</title> </head> <body onunload="if (opener) opener.endTimer()"> </body> </html> |
[ Voor 23% gewijzigd door crisp op 26-04-2003 17:10 ]
Intentionally left blank
Pagina: 1