detecting browser closure


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: detecting browser closure

  1. #1
    Alan Shiers Guest

    detecting browser closure

    Hi there:
    I've created a client/server application. The client app is an
    applet viewed in a browser while the server app sits on a web server.
    Basically, I just wanted to know if there is a way for the applet to
    detect when the user decides to close down the browser that is
    displaying the applet? If so how? What I would like to do is send a
    string message to the server app before his browser window actually
    closes.

    Alan


  2. #2
    Patel Guest

    Re: detecting browser closure


    Dear Alan,
    Basically when you try to close your window you are ending up your
    applet life. So In the stop method you can add your whatever kind of code
    that you want. TRY THOSE PORNO SITE DEVELOPERS THEY ARE MASTERS OF THESE
    THINGS.

    Alan Shiers <jshiers@istar.ca> wrote:
    >Hi there:
    > I've created a client/server application. The client app is an
    >applet viewed in a browser while the server app sits on a web server.
    >Basically, I just wanted to know if there is a way for the applet to
    >detect when the user decides to close down the browser that is
    >displaying the applet? If so how? What I would like to do is send a
    >string message to the server app before his browser window actually
    >closes.
    >
    >Alan
    >



  3. #3
    Patel Guest

    Re: detecting browser closure


    You got it Kim.
    devx@finao.co.uk (Kim Fowler) wrote:
    >Hi
    >There are four life cycle methods that you can use in an Applet:
    >
    >1. init() called when the Applet is first launched, useful for
    >initialisation
    >
    >2. start() called immediately after init() and whenever the user
    >returns to the applet page after navigating somewhere else (possibly
    >forward / back hit)
    >
    >3. stop() called whenever the user moves to another page, this can be
    >used to temporarily cease expense processes e.g. graphics wotk until
    >they return - start() - it does not necessarily mean that the browser
    >has closed only that the user has moved
    >
    >4. destroy() called when the browser shuts down normally, if the user
    >is on the applet page at this timme then the sequence will be stop()
    >ollowed by destroy(), if the user is on another page then you just get
    >the destroy()
    >
    >destroy() sounds a good bet to me :-)
    >
    >HTH
    >
    >On Tue, 26 Sep 2000 15:08:42 -0300, Alan Shiers <jshiers@istar.ca> did
    >scribble:
    >
    >>Hi there:
    >> I've created a client/server application. The client app is an
    >>applet viewed in a browser while the server app sits on a web server.
    >>Basically, I just wanted to know if there is a way for the applet to
    >>detect when the user decides to close down the browser that is
    >>displaying the applet? If so how? What I would like to do is send a
    >>string message to the server app before his browser window actually
    >>closes.
    >>
    >>Alan
    >>

    >



  4. #4
    Kim Fowler Guest

    Re: detecting browser closure

    Hi
    There are four life cycle methods that you can use in an Applet:

    1. init() called when the Applet is first launched, useful for
    initialisation

    2. start() called immediately after init() and whenever the user
    returns to the applet page after navigating somewhere else (possibly
    forward / back hit)

    3. stop() called whenever the user moves to another page, this can be
    used to temporarily cease expense processes e.g. graphics wotk until
    they return - start() - it does not necessarily mean that the browser
    has closed only that the user has moved

    4. destroy() called when the browser shuts down normally, if the user
    is on the applet page at this timme then the sequence will be stop()
    ollowed by destroy(), if the user is on another page then you just get
    the destroy()

    destroy() sounds a good bet to me :-)

    HTH

    On Tue, 26 Sep 2000 15:08:42 -0300, Alan Shiers <jshiers@istar.ca> did
    scribble:

    >Hi there:
    > I've created a client/server application. The client app is an
    >applet viewed in a browser while the server app sits on a web server.
    >Basically, I just wanted to know if there is a way for the applet to
    >detect when the user decides to close down the browser that is
    >displaying the applet? If so how? What I would like to do is send a
    >string message to the server app before his browser window actually
    >closes.
    >
    >Alan
    >



  5. #5
    Alan Shiers Guest

    Re: detecting browser closure

    Thanks fellas. That was all the info I needed. I kinda figured there
    had to be a simple way to do this, I just wasn't privy to the right way
    to do this.

    Alan




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center