-
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
-
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
>
-
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
>>
>
-
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
>
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks