close window event

Discussion in 'Javascript' started by Ubi, Dec 14, 2007.

  1. Ubi

    Ubi Guest

    I have a popup and I would like to capture the close window event.
    How can I do that in javascript?


    Daniele
     
    Ubi, Dec 14, 2007
    #1
    1. Advertising

  2. Ubi

    Stevo Guest

    Ubi wrote:
    > 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.
     
    Stevo, Dec 14, 2007
    #2
    1. Advertising

  3. Ubi

    Ubi Guest

    >> 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? ;-)

    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
     
    Ubi, Dec 14, 2007
    #3
  4. Ubi

    Stevo Guest

    Ubi wrote:
    >>> 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.

    > 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.
     
    Stevo, Dec 14, 2007
    #4
  5. Ubi

    Ubi Guest

    >>>> 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.


    Who do you think I am? I am not a bad guy :-(


    >> 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
     
    Ubi, Dec 14, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    6
    Views:
    8,932
    sateeshranga
    Aug 7, 2008
  2. Iñaki Baz Castillo
    Replies:
    7
    Views:
    939
    Iñaki Baz Castillo
    Jan 12, 2010
  3. Walter Beierdonck

    Self.close() window without the dialog close?Yes/NO

    Walter Beierdonck, Apr 29, 2004, in forum: Javascript
    Replies:
    1
    Views:
    371
    Grant Wagner
    Apr 30, 2004
  4. Replies:
    3
    Views:
    442
    Chung Leong
    Jan 16, 2005
  5. Shang Wenbin

    close current window using window.close()

    Shang Wenbin, Sep 1, 2005, in forum: Javascript
    Replies:
    10
    Views:
    422
    Gérard Talbot
    Sep 2, 2005
Loading...

Share This Page