有这个Excel文件,我希望用户能够从我的服务器下载.单击"下载"按钮后,必须有一种简单的方法来启动文件下载...但我不知道如何实现这一点.
到目前为止我有这个:(VBscript和ASP)
<head>
<script type="text/javascript" src="overzicht.js"></script>
</head>
Set fs=Server.CreateObject("Scripting.FileSystemObject")
if (fs.FileExists("c:\file.xls"))=true then 'fake filename D:
response.write("<input type='button' value='Download Masterfile' class='button' onclick='exportmasterfile();' /><br />")
else
response.write("Masterfile not found. <br />")
end if
set fs=nothing
Run Code Online (Sandbox Code Playgroud)
javascript函数为空.
为什么这不适用于Safari?
<script language="javascript" type="text/javascript">
function changeUrl(url) {
window.location.href='http://google.com';
return false;
}
</script>
<form action="#" onsubmit="changeUrl(this)" />
<input type="Submit" value="Go" />
</form>
Run Code Online (Sandbox Code Playgroud)