1

尝试使用 java-script 下载文件时出现以下错误。

错误:

Internet Explorer cannot download Sample.doc from www.websitename.com.

Internet Explorer was not able to open this Internet site. The request is either unavailable or cannot be found.Please try again later.

HTML:

<html>
<head>
<script type="text/javascript" language="javascript"> 
function winopen() 
{ 
  window.open("Sample.doc","_self","fullscreen=no,toolbar=yes, width=800, height=600, menubar=yes, status=no,scroll=yes"); 
} 
</script>
</head>
<body onload="winopen();">
</body>
</html>

有谁知道如何解决这个问题?谢谢。

4

2 回答 2

0

我希望它会有所帮助

http://support.microsoft.com/kb/812935

http://support.microsoft.com/kb/316431

于 2011-02-02T09:43:16.057 回答
0

您需要将尝试获取的资源的完整有效 URI 传递给window.open函数。例如,从 BBC 网站下载样式表:

window.open("http://static.bbc.co.uk/homepage/css/bundles/domestic/main.css?661" "_self","fullscreen=no,toolbar=yes, width=800, height=600, menubar=yes, status=no,scroll=yes");

顺便说一句, http://www.websitename.com上没有网站 ;-)

HTH。

于 2011-02-02T11:08:32.797 回答