2011-02-03 79 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");