Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#290 closed defect (fixed)

onunload doesn't work with connect

Reported by: david Owned by: alex
Priority: high Milestone:
Component: Core Version: 0.2
Keywords: event Cc:
Blocked By: Blocking:


From mailing list post:

i specify my page unload as follows:
    dojo.event.connect(window, "onunload", function (){myUnload();});
but when the page unloads,
i get the runtime error:
    "function "__1" does not exist on "[object]""
i guess it's complaining about 'window' but why?
any thoughts?

Change History (7)

comment:1 Changed 16 years ago by bill

I think this was because you have to specify it as a "before" event.

dojo.event.connect("before" window, "onunload", function (){myUnload();});

comment:2 Changed 16 years ago by alex

Component: CoreDocumentation
Milestone: 0.3release
Resolution: fixed
Status: newclosed

you will indeed need to connect before. Nothing to be done about this.

comment:3 Changed 16 years ago by bill

Resolution: fixed
Status: closedreopened

Hmm, I can't get it to work, even with "before":


type: "before", srcObj: window, srcFunc: "onunload", targetFunc: function(){ alert("unloading!"); }


comment:4 Changed 16 years ago by anonymous

Component: DocumentationCore

comment:5 Changed 16 years ago by sjmiles

Milestone: 0.3release0.3.1

dojo.browser.event stomps on window.onunload to provide a handler on IE that provides memory-leak protection (therefore it must be the last event handled by the system).

This needs to be brought together with an a generalized 'addOnUnload' and 'unloaded' mechanism in the core.

comment:6 Changed 16 years ago by alex

Resolution: fixed
Status: reopenedclosed

I've added a new dojo.addOnUnload() method to the core. You can register your handler thorugh this or do a dojo.event.connect() to the new dojo.unloaded() method. Fixed in [4275]

comment:7 Changed 15 years ago by (none)

Milestone: 0.3.1

Milestone 0.3.1 deleted

Note: See TracTickets for help on using tickets.