Hi evebody,
I need to stop the browser shutoff before close it (like when we close the Operating System and there is a modified document opened).
Is there something like this?
Thanks.
Printable View
Hi evebody,
I need to stop the browser shutoff before close it (like when we close the Operating System and there is a modified document opened).
Is there something like this?
Thanks.
I'm not quite sure what you mean. Do you mean "How can I run code before the browser window (Internet Explorer, Netscape Navigator) is closed?". If so, you can use Javascript.
Yes. Almost it. Actually I have two problens.
I have a login window and I want to exec a script in the server if someone:
1) close the browser window
The first one is a problem only in the Netscape browser, because the event OnUnload in the Internet Explorer works when someone close or refresh the browser window, in the Netscape is only executed when someone refresh the browser window.
2) turn off the computer
This is a hard problem, because in both browsers the event OnUnload is not executed.
Because of these two problens I´m asking if an Applet Java could do this.
For the first problem, that's basically what I was suggesting. I think it might be a good idea to put that post on a JavaScript forum. Someone might know the function name for navigator (this still wouldn't work if someone has JavaScript disabled, though).
An applet might solve your problems by using the public void destory method as:
"The destroy method is called when the browser exits. Your applet should implement this method to do final cleanup such as stop live threads."
Give it a try.
The second problem is really difficult. It would be really difficult to distinguish between your program simply being terminated and your computer shutting down. I can't think of a nice way of doing it.
Hope this helps,
ArchAngel.