Opened 15 years ago
Closed 13 years ago
#786 closed defect (wontfix)
dojo.event.connect not showing onbeforeunload prompt
Reported by: | Owned by: | alex | |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Events | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The following non-dojo.event.connect code shows a "got here" alert followed by a "this is a test prompt" dialog.
dj_global.onbeforeunload = function() { alert('got here'); return 'this is a test prompt'; }
However, when we use dojo.event.connect, we just get the "got here" alert.
dojo.event.connect(dj_global, 'onbeforeunload', dojo.lang.hitch(this, function(event) { alert('got here'); return 'this is a test prompt'; }));
I would have expected the behavior to be the same in both cases.
Also it would be useful if dojo.event.connect worked with onunload; then we could prevent one onbeforeunload handler from overwriting another.
Change History (2)
comment:1 Changed 15 years ago by
Component: | Core → Events |
---|---|
Milestone: | → 0.5 |
Owner: | changed from anonymous to alex |
comment:2 Changed 13 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Yeah, you should use dojo.addOnUnload(). I think the problem with the above connect is that it tries to happen after page unload, which is of course too late.