html下载本地
摘要:通过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>
【html下载本地】相关文章:
★ 详解JavaScript中Date.UTC()方法的使用
★ JavaScript基于setTimeout实现计数的方法
★ jQuery实现控制文字内容溢出用省略号(…)表示的方法
下一篇:
强制设为首页代码