html格式文件的下载
.html下载本地
通过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>
顶一下
(1)
33.3%
踩一下
(2)
66.7%
- 上一篇:Javascript 小技巧全集
- 下一篇:没有了
- 最新评论 查看所有评论
-
- 发表评论 查看所有评论
-
2012 cheap ugg ugg uggs uggs ugg ugg uggs ugg ugg ugg uggs boots ugg ugg UGGS boots uggs boots. tory burch shoes tory burch outlet for sale.
