Opened 4 years ago

Closed 15 months ago

#11140 closed defect (fixed)

File Uploader destroyed in ie8 when using href with javascript:

Reported by: trutwijd Owned by: mwilcox
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 trutwijd 4 years ago.
test case

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by trutwijd

test case

comment:1 Changed 4 years ago by trutwijd

oops - please add pretty print code comments around the stuff

comment:2 Changed 4 years ago by trutwijd

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 3 years ago by mwilcox

  • Milestone changed from tbd to 1.5.1

comment:4 Changed 3 years ago by dante

  • Milestone changed from 1.5.1 to 1.7

there is no 1.5.1

comment:5 Changed 21 months ago by csnover

  • Milestone changed from 1.8 to 2.0

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

comment:6 Changed 15 months ago by mwilcox

  • Milestone changed from 2.0 to 1.9
  • Resolution set to fixed
  • Status changed from new to closed

Fixed as per duplicate #15285

Note: See TracTickets for help on using tickets.