Connecting Tech Pros Worldwide Forums | Help | Site Map

close window event

Ubi
Guest
 
Posts: n/a
#1: Dec 14 '07
I have a popup and I would like to capture the close window event.
How can I do that in javascript?


Daniele



Stevo
Guest
 
Posts: n/a
#2: Dec 14 '07

re: close window event


Ubi wrote:
Quote:
I have a popup and I would like to capture the close window event.
How can I do that in javascript?
Daniele
Hmm. I know what this smells like.
Ubi
Guest
 
Posts: n/a
#3: Dec 14 '07

re: close window event


>I have a popup and I would like to capture the close window event.
Quote:
Quote:
>How can I do that in javascript?
>Daniele
>
Hmm. I know what this smells like.
Does it smell like teen spirits? ;-)

I have a web tv:
http://www.cinemaitaliano.info/tv/

I would like to know for how long a visitor stays watching.
I am logging in the database the time when the user opens the window.
I would like to log the time he closes the window, but I don't know how. I
suppose I have to detect the close windows event.

Daniele


Stevo
Guest
 
Posts: n/a
#4: Dec 14 '07

re: close window event


Ubi wrote:
Quote:
Quote:
Quote:
>>I have a popup and I would like to capture the close window event.
>>How can I do that in javascript?
>>Daniele
>Hmm. I know what this smells like.
Does it smell like teen spirits? ;-)
Smelled like those nasty ad popups that won't go away initially.
Quote:
I have a web tv:
http://www.cinemaitaliano.info/tv/
I would like to know for how long a visitor stays watching.
I am logging in the database the time when the user opens the window.
I would like to log the time he closes the window, but I don't know how. I
suppose I have to detect the close windows event.
Daniele
You can log it easily from the popup itself. Just attach a function to
window.onunload and it can "ping" your tracking system. Or it can make a
call to the parent (opener) window to say it's about to close.
Ubi
Guest
 
Posts: n/a
#5: Dec 14 '07

re: close window event


>>>I have a popup and I would like to capture the close window event.
Quote:
Quote:
Quote:
>>>How can I do that in javascript?
>>>Daniele
>>Hmm. I know what this smells like.
>Does it smell like teen spirits? ;-)
>
Smelled like those nasty ad popups that won't go away initially.
Who do you think I am? I am not a bad guy :-(

Quote:
Quote:
>I have a web tv:
>http://www.cinemaitaliano.info/tv/
>I would like to know for how long a visitor stays watching.
>I am logging in the database the time when the user opens the window.
>I would like to log the time he closes the window, but I don't know how.
>I suppose I have to detect the close windows event.
>Daniele
>
You can log it easily from the popup itself. Just attach a function to
window.onunload and it can "ping" your tracking system. Or it can make a
call to the parent (opener) window to say it's about to close.
OK, I'll try with the onunload event.

Thanks!

Daniele


Closed Thread