html下载本地
html下载本地
发布时间:2016-12-29 来源:查字典编辑
摘要:通过javascript实现index.html下载文件#######temp.html//被下载文件if(typeof(window.op...

通过javascript 实现

index.html

<a href=#>下载文件</a>

#######

temp.html //被下载文件

<Script language="javascript">

if (typeof(window.opener) != 'undefined') //判断 打开方式的下载。去掉会一打开文件就弹出下载框

{

document.execCommand('SaveAs');

window.close();

}

</Script>

################

<button>保存本页面</button>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新Javascript教程学习
热门Javascript教程学习
编程开发子分类