简体   繁体   中英

Extjs Element component load event not firing in Safari or Chrome

I am creating an Iframe and adding it to the current document and it is being used as a file download target. Here is the code...

var dl = Ext.DomHelper.append(document.body, {
    tag: 'iframe',
    id:'downloadIframe',
    frameBorder: 0,
    width: 0,
    height: 0,
    css: 'display:none;visibility:hidden;height:0px;',
    src: 'http:\\www.fg.com\something\something\darkside.pdf'
});

Ext.get(dl).on('load', function(e, t, o) {
    alert('ready to save or open the pdf')
});

This works perfectly in Firefox but not in Chrome nor Safari. My guess is that both don't create a popup dialog that asks the user whether to save or open the file. Correct me if I'm wrong, but I think for both Chrome and Safari, it automatically downloads the file.

How do I then check if the file has been downloaded for Safari & Chrome?

Thanks in advance!

I've got a similar problem but it happens in Firefox 4.0 as well. (The code isn't the same at all). How about trying something like

Ext.Msg.alert(a.caption, a.msg);

?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM