@H_403_3@
我有以下代码在Chrome和IE中正常工作.用户单击锚标记并执行代码,然后在新选项卡中呈现pdf文件,其中包含url blob:
http://localhost:57389/5aee262a-8bc9-4943-b67f-7b76aeef4b99
vme.loadAttachment = function (attachment) { taskService.getAttachmentContent(attachment.Name) .then(function (response) { var file = new Blob([response],{ type: attachment.Type }); if (window.navigator && window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveOrOpenBlob(file); } else { var objectUrl = URL.createObjectURL(file); window.open($sce.trustAsResourceUrl(objectUrl),_blank"); } }) };
但是在Firefox上,新选项卡已打开,但会立即关闭.知道是什么原因引起的吗?
解决方法
@H_403_3@