Re: Gecko DOM window onclose event ?



Luke Matuszewski wrote:

> Thomas 'PointedEars' Lahn napisal(a):
>> Danny wrote:
>> > is not .onclose, is .onunload :).
>>
>> It is well known that the `unload' event also fires when the document is
>> unloaded, i.e. when the location changes. Please get informed before you
>> try to help here.
>
> Yes.
> Question in topic refers to my older post

Threads should be continued if the subject virtually is the same.

> on How to detect that a user closes a user agent window - where i
> suggested the spying popup which examines window.opener
> (window.opener.closed) properties. I ask about onclose, because i
> wanted to attach that event on Gecko browsers

1. `onclose' is not an event, it is an event handler. The respective event
would be named `close'. However, there is of course no such event in
W3C DOM Level 2 Events (or the Working Group Note on DOM Level 3 Events),
so using addEventListener() is not very likely to work in the first
place.

2. You cannot add previously unsupported event handlers to the implemented
DOM.

3. The Gecko DOM appears to support such an event handler:

<URL:http://developer.mozilla.org/en/docs/DOM:window#Event_Handlers>

Historically, event handlers can be assigned event listeners with
assignment of a Function object reference to the respective property
of the target object. However, it is not described that returning a
false-value will cancel the respective event.

> PS i tried to open window in JS (popup via window.open) and added to
> returned reference the event onclose... closed the opened window but
> onclose was not fired :(

So, ignoring that your examples were not Valid HTML, the event handler
appears not to be supported yet or not longer to be supported in the
Gecko DOM.

Would you please learn to quote?


PointedEars
.



Relevant Pages

  • Re: XMLHTTPRequest variable and callback function question
    ... Care to elaborate on what really caused the problem? ... > Also I have modified the order of the callback function declaration. ... ACK, however that is no callback, it is an event handler. ... > Thomas 'PointedEars' Lahn wrote: ...
    (comp.lang.javascript)
  • Re: 3 problems. All IE6. Bubbling. Source Order. Repeating
    ... event handler itself. ... I am a little rusty on the definition of listener and handler. ... a fire, the FBI and the NSA need to be ... Thank you again PointedEars, always helping. ...
    (comp.lang.javascript)
  • Re: Knowing when graphics have loaded
    ... > Thomas 'PointedEars' Lahn wrote: ... >>> Any ideas on how I can tap into what my browser knows would be ... > tag does not fire and assume this is what you mean by the 'onload' ... I have observed that the `onload' event handler attribute for ...
    (comp.lang.javascript)
  • Re: Knowing when graphics have loaded
    ... >> Thomas 'PointedEars' Lahn wrote: ... I have observed that the `onload' event handler attribute for ...
    (comp.lang.javascript)
  • Re: Class Modules?
    ... One way is to open a dummy form with the hidden option as part of your ... startup. ... Put your code on the *OnClose* event handler. ...
    (microsoft.public.access.modulesdaovba)