Opened 9 years ago

Closed 6 years ago

#11140 closed defect (fixed)

File Uploader destroyed in ie8 when using href with javascript:

Reported by: Josh Trutwin Owned by: Mike Wilcox
Priority: high Milestone: 1.9
Component: DojoX Uploader Version: 1.3.2
Keywords: fileUploader disappear ie8 Cc:
Blocked By: Blocking:

Description

Ugh - chased this weird one for a while to find out that dojo.addOnUnload() is getting fired in ie8 (ie7/6?) when you use an href like this on a page with an uploader:

<a href="javascript: blah();">click me</a>

Per dojo.addOnUnload source doc:

description: The first time that addOnWindowUnload is called Dojo will register a page listener to trigger your unload handler with. Note that registering these handlers may destory "fastback" page caching in browsers that support it. Be careful trying to modify the DOM or access JavaScript? properties during this phase of page unloading: they may not always be available. Consider dojo.addOnUnload() if you need to modify the DOM or do heavy JavaScript? work since it fires at the eqivalent of the page's "onbeforeunload" event.

Attaching a test case.

Not sure if there's a better way to do the uploader destroy() behavior to prevent this???

Attachments (1)

upload_dlg_test.html (1.3 KB) - added by Josh Trutwin 9 years ago.
test case

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by Josh Trutwin

Attachment: upload_dlg_test.html added

test case

comment:1 Changed 9 years ago by Josh Trutwin

oops - please add pretty print code comments around the stuff

comment:2 Changed 9 years ago by Josh Trutwin

ack, I pasted the wrong comments:

//              In a browser enviroment, the functions will be triggered
//              during the window.onbeforeunload event. Be careful of doing
//              too much work in an unload handler. onbeforeunload can be
//              triggered if a link to download a file is clicked, or if
//              the link is a javascript: link. In these cases, the
//              onbeforeunload event fires, but the document is not
//              actually destroyed. So be careful about doing destructive
//              operations in a dojo.addOnUnload callback.

comment:3 Changed 8 years ago by Mike Wilcox

Milestone: tbd1.5.1

comment:4 Changed 8 years ago by dante

Milestone: 1.5.11.7

there is no 1.5.1

comment:5 Changed 7 years ago by Colin Snover

Milestone: 1.82.0

1.8 has been tagged; moving all outstanding tickets to next major release milestone.

comment:6 Changed 6 years ago by Mike Wilcox

Milestone: 2.01.9
Resolution: fixed
Status: newclosed

Fixed as per duplicate #15285

Note: See TracTickets for help on using tickets.