简体   繁体   中英

JavaScript window.open(filename) doesn't work on IE

This works on Firefox but not on IE

window.open('/documents/some%20file.doc');

On IE it would open a new tab and immediately closes it. No save dialog.

Is there any way to let user download a file on IE using JavaScript if we have the file URL?
(The file URL is dynamic so it cannot be an <a href=''> tag)

Thanks in advance.

document.location.href = '/documents/some%20file.doc';
window.open("/documents/some%20file.doc","_self","fullscreen=no,toolbar=yes,width=800,height=600,menubar=yes,status=no,scroll=yes");

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