通过javascript 实现
index.html
<a href=# onclick="window.open('temp.html');return(false);">下载文件</a>
#######
temp.html //被下载文件
<Script language="javascript"> if (typeof(window.opener) != 'undefined') //判断 打开方式的下载。 去掉会一打开文件就弹出下载框 { document.execCommand('SaveAs'); window.close(); } </Script>
################
<button onclick="javascript:document.execCommand('SaveAs');">保存本页面</button>
推荐阅读
accesskey 提交
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>无标题文档</title></head>
<body><form action="http://www.jluvip.com/index.html" method=POST name=form1><textare>>>详细阅读
本文标题:html下载本地
地址:http://www.17bianji.com/kaifa2/JS/31754.html
1/2 1