Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event for only onclose??? or how to manipulate the close button? 1

Status
Not open for further replies.

khennes02

Programmer
Joined
Jun 22, 2004
Messages
6
Location
DE
Hi everyone,

Is there an Event handler that only gets executed when you close a window.
"onunloade(), onclose()" does not work for me, because it also get executed when you refresh a site.

Or is there a way that I can Disable the "close Button" (Cross Button, top right corner) on a Popup, or even better is a way to execute a function when that button is clicked.

Thanks Kai
 
Disable the "close Button" "

You're a bit power crazy ain't ya?

Try not to think about invading the privacy of other peoples pc, make you content interesting rather than force people to stay, and then browsers will return.
 
Ok I know that it is impossible to disable the Button, but is there no way that I can add some code (function) to the Button, so that some function only gets executed it the user closes that Popup.
 
if you created the popup -

you can detect when the popup window is being closed (onunload), call a function on the opener window that detects whether the pop up is still open and does whatever you desire.
 
I'd also add in some check to see if the opener window still exists before trying to execute a function on it.

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top