onBeforeUnload Alternative

L

lltaylor

Hello,

Currently I use an onbeforeunload method, to do call various tidy up
methods
when a user exits my web application - however I now need to add
additional support, for users migrating to Sun's JVM.

My understanding that the onbeforeunload call is a Microsoft one, and
the net
result of having it in a page used by a SUN JVM user is that the
browser does not close.

Does anyone know of an alternative to this method, that is supported
by Sun's JVM??????

Thanks in advance

Lloyd
 
T

Thomas 'PointedEars' Lahn

Lloyd said:
No URL to offer as it run on an internal apache:tomcat server.

The onbeforeunload call is made in the body tag,

You probably meant to say that in the start tag of the "body" element there
is a "onbeforeunload" attribute which causes the (one) user agent you have
tested with to execute its value as script code on a certain event.
which in turn calls myCleanUpMethod()
<body onbeforeunload="myCleanUpMethod()" >

And what is myCleanUpMethod()? You could have provided this,
but now it really does not matter anymore (see below).
The method onBeforeUnload is a JSCRIPT method which fires prior to a page
being unloaded.

No, it is an intrinsic event handler of the IE(4+) DOM, thus it works only
in this user agent and, BTW, using the handler within HTML context makes the
document invalid or, strictly speaking, no HTML at all:

<http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onbeforeunload.asp>
<http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.3>

Coincidental the ECMAScript implementation that IE supports is JScript,
but that has nothing to do with the UA's DOM. For example, with IE
VBScript code could be executed in the listener.
It is not supported in Sun's JVM (hangs the browser)

Nonsense. Java != J(ava)Script. Sun provides a _Java_
Virtual Machine, not a J(ava)Script Virtual Machine.

and I was hence wondering if there was an alternative in javascript,
the onUnload isn't any good as it fires too late.

Revise your Web application, its concept is flawed.
[Top post]

<http://jibbering.com/faq/#FAQ2_3>


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top