首页 电脑 电脑学堂 查看内容

通过javascript实现.html格式文件的下载

2009-10-6 10:33 588 0

摘要: .html下载本地 通过javascript 实现 index.html <a href=# onclick="window.open('temp.html');return(false)...
关键词: nbsp 保存本 html 文件 javascript 页面 index temp

.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>  
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部