热门关键字:  PHP  Cisco  seo  网络广告 虚拟主机 中文域名
当前位置 :| 主页>网页特效>

html格式文件的下载

来源:不详 作者:未知 时间:2005-12-24 点击:

.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>


上一篇:Javascript 小技巧全集
下一篇:没有了
最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
赞助商连接