can anybody will tell me how to capture browser close event? if i use ononload event..then prob. is it is getting fired on refrashing the browser..i have used window.close() it is cool but how to get which button use has pressed..i mean window.close() alert us with yes or no whther u wanna close or not i wanna to get that vakue...my purpose is to abendone the session if some1 press yes..