Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > "OnClose" window event

Reply
Thread Tools

"OnClose" window event

 
 
Kamyk
Guest
Posts: n/a
 
      03-01-2005
Hello all!

I know that in HTML there is no such event, but is it possible to make event
on close a window. If so, please write me example how to do it.

Thank you in advance
Marcin from Poland


 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      03-01-2005
"Kamyk" <(E-Mail Removed)> wrote:

>I know that in HTML there is no such event, but is it possible to make event
>on close a window. If so, please write me example how to do it.


What do you want to do and why? If we know more details we may be able
to suggest alternatives.

There's onUnload but that get's triggered when a link is followed and
as it's often misused for nefarious purposes I believe some browsers
are starting to give users the ability to switch it off.

If the window in question was created by another window the the
creating window can check for the existance of the created window.
Hence you could run a check periodically, or whenever the creating
window recieves focus and perform an action then if the created window
no longer exists. Of course that's no good if the creating window is
closed first.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
 
Kamyk
Guest
Posts: n/a
 
      03-01-2005
> >I know that in HTML there is no such event, but is it possible to make
event
> >on close a window. If so, please write me example how to do it.

>

I want to delete one value from one column from the database using a SQL
query
after clicking "x" on the window. So how to link it with a event. Is it
possible?

Marcin from Poland


 
Reply With Quote
 
Adrienne
Guest
Posts: n/a
 
      03-01-2005
Gazing into my crystal ball I observed "Kamyk"
<(E-Mail Removed)> writing in news:d02jf7$59c$1
@news.onet.pl:

>> >I know that in HTML there is no such event, but is it possible to

make
>> >event on close a window. If so, please write me example how to do it.

>>

> I want to delete one value from one column from the database using a

SQL
> query
> after clicking "x" on the window. So how to link it with a event. Is it
> possible?
>
> Marcin from Poland
>
>
>


That's very BAD idea. If there is no javascript available, you will not
have an event. If you do have javascript, and the window is not closed,
how is your script going to fire? You need to rethink your application.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      03-01-2005
Kamyk wrote:

> I want to delete one value from one column from the database using a SQL
> query after clicking "x" on the window. So how to link it with a event. Is
> it possible?


Not really, no. Certainly not with any degree of reliability.


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
Kamyk
Guest
Posts: n/a
 
      03-01-2005
I thought that my idea is good, because for example I will have a button
"Log off" which will delete
me a value from a record after clicking on. But what about the situation
when somebody will not
click on the button "log off" and he close the window. In that situation the
value which I want to delete
will be available in the record in the database.

Please verify my thinking.

Marcin from Poland


 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      03-01-2005
Kamyk wrote:

> what about the situation when somebody will not click on the button "log
> off" and he close the window. In that situation the value which I want to
> delete will be available in the record in the database.


Do the same as everybody else - accept that HTTP is a stateless protocol and
have a program that runs on a timer and cleans out sessions that have been
inactive for $too_long seconds.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
Kamyk
Guest
Posts: n/a
 
      03-01-2005
> Do the same as everybody else - accept that HTTP is a stateless protocol
and
> have a program that runs on a timer and cleans out sessions that have been
> inactive for $too_long seconds.


Could you be so kind and give me the code example, because I`m a the
beginner
of HTML and Javascript. I would like to do web page using ASP language
(vbscript).

Thank you in advance
Marcin


 
Reply With Quote
 
Noozer
Guest
Posts: n/a
 
      03-01-2005

"Kamyk" <(E-Mail Removed)> wrote in message
news:d02lcs$k9u$(E-Mail Removed)...
> I thought that my idea is good, because for example I will have a button
> "Log off" which will delete
> me a value from a record after clicking on. But what about the situation
> when somebody will not
> click on the button "log off" and he close the window. In that situation

the
> value which I want to delete
> will be available in the record in the database.
>
> Please verify my thinking.


Remember that webpages are "one way"... data comes to the client and the
client does something. The only way for the client to communicate back to
the server is to either pass values when loading the next page or save
cookies before loading the next page. The next page will then act on the
data it recieves once it's loaded into the client machine. Using ASP you can
have the server perform some actions on the passed data (but not cookies)
during execution on the server. You can NEVER count on the next page
actually being loaded or that the user will close the page or browser
properly.

As long as you keep the above in mind you should be able to develop a proper
program flow.


 
Reply With Quote
 
Adrienne
Guest
Posts: n/a
 
      03-01-2005
Gazing into my crystal ball I observed "Kamyk"
<(E-Mail Removed)> writing in
news:d02nok$dkq$(E-Mail Removed):

>> Do the same as everybody else - accept that HTTP is a stateless
>> protocol and have a program that runs on a timer and cleans out
>> sessions that have been inactive for $too_long seconds.

>
> Could you be so kind and give me the code example, because I`m a the
> beginner
> of HTML and Javascript. I would like to do web page using ASP language
> (vbscript).
>
> Thank you in advance
> Marcin
>
>


You should really post this to an ASP group,
microsoft.public.inetserve.asp.general would be a good idea, or Google in
the group in the past month and you might find what you're looking for.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
window to window communication (window.opener) Andrew Bewley via DotNetMonster.com ASP .Net 0 02-03-2005 12:59 PM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
Solution: Raising an Event Handler Postback on Parent Window From Popup Child Window Dialog Box Earl Teigrob ASP .Net 1 06-16-2004 04:19 PM
Popup window to raise event in parent window...can it be done??? Earl Teigrob ASP .Net 4 06-04-2004 11:47 PM
Event On Form From Control Event Dave Wurtz ASP .Net 1 12-09-2003 10:37 PM



Advertisments