first, it's not for pop-up.
I have a web application, in which I open a window and connect to a device.
there I have a page with tabs that loads the same page with different parameters.
I have a close button, when it's pressed I close the connection.
the problem is if the user pressed the X button at the top right corner.
I have to close the connection ( closing the connection is by sending a string to a the server through socket)
onUnload is not good (I think ) because every time I move with the tabs I load the page again - but the connection
should still be open.
can it be done?
Thanks
Guy
closing a window - in depth?
Moderator: General Moderators
Well, if you have the webapp in frames, where one frame is not visible, and the other one has the actual application in, when you close the window, it'll activate the onUnoad you hid in the invisible frame.
That way, you keep the connection open while you're using the app, and when you close the window, the connection can be broken
That way, you keep the connection open while you're using the app, and when you close the window, the connection can be broken