代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<button onclick="xz()">下载模板</button>
</body>
<script>
function xz(){
window.open('file/test.xls');
}
</script>
</html>
需要事先把文件放到工程中去
测试:
代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<button onclick="xz()">下载模板</button>
</body>
<script>
function xz(){
window.open('file/test.xls');
}
</script>
</html>
需要事先把文件放到工程中去
测试: