By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Detecting browser close event using Jscript or php

P: 60
Hi
I am trying to use Javascript in order to detect when a user
presses the little 'X' at the top right hand corner of the window or uses
File..Close, in order to process some code before hand. If unload event is used in body tag , then each and every time whenever the form unloads the javascript function would fire. But i want to fire that function only when the close button
( X ) in the top right corner is pressed. Can anyone help me
out if they know the eventhandler, or are familiar with another method for
doing this?
Thanks,
somas karthic
Aug 25 '06 #1
Share this Question
Share on Google+
3 Replies


P: 60
Hi
I am trying to use Javascript in order to detect when a user
presses the little 'X' at the top right hand corner of the window Iin order to process some code before hand. If i use unload function each and every time it is calling that javascript function . I want to call that function only when X button in top right corner is clicked. Can anyone help me
out if they know the eventhandler, or are familiar with another method for
doing this?
Thanks,
somaskarthic
Aug 25 '06 #2

iam_clint
Expert 100+
P: 1,208
http://www.siteexperts.com/forums/vi...d=15413&Sort=0

check this linkk for further help, this would not be done in PHP but javascript

php is a serverside type scripting
javascript is client side

so saying this the server can't determine when the user clicks the x at the top right.
Aug 25 '06 #3

iam_clint
Expert 100+
P: 1,208
http://www.siteexperts.com/forums/v...id=15413&Sort=0

check this linkk for further help, this would not be done in PHP but javascript

php is a serverside type scripting
javascript is client side

so saying this the server can't determine when the user clicks the x at the top right.
Aug 25 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.