2011-02-03 82 views
2

这适用于Firefox的工作,但不能在IEJavaScript的window.open(文件名)不能在IE

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

在IE会打开一个新的标签,并立即关闭它。没有保存对话框。

如果我们有文件URL,有什么办法让用户使用JavaScript下载IE上的文件?
(该文件的URL是动态的,因此它不能是一个<a href=''>标记)

在此先感谢。

回答

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