Connecting Tech Pros Worldwide Forums | Help | Site Map

Detecting browser close event using Jscript or php

Member
 
Join Date: Aug 2006
Posts: 60
#1: Aug 25 '06
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

Member
 
Join Date: Aug 2006
Posts: 60
#2: Aug 25 '06

re: Detecting browser close event using Jscript or php


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
iam_clint's Avatar
Forum Leader
 
Join Date: Jul 2006
Location: Oklahoma
Posts: 1,076
#3: Aug 26 '06

re: Detecting browser close event using Jscript or php


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.
iam_clint's Avatar
Forum Leader
 
Join Date: Jul 2006
Location: Oklahoma
Posts: 1,076
#4: Aug 26 '06

re: Detecting browser close event using Jscript or php


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