开发者

Extjs Element component load event not firing in Safari or Chrome

开发者 https://www.devze.com 2022-12-27 22:16 出处:网络
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...

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('rea开发者_如何学编程dy 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);

?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号