用js保存页面指定内容
来源:互联网 发布:电脑时钟同步软件 编辑:程序博客网 时间:2024/04/30 00:41
用js保存页面指定内容
转自: http://rorchina.iteye.com/blog/184425
- <script language=javascript>
- function Save(){
- var txt = document.all.output.value;
- b = window.open();
- b.document.open();
- b.document.write(txt);
- b.document.close();
- b.document.execCommand('saveas',true,'output.html');
- b.window.close();
- }
- </script>
- <center>仅保存文本框中部分:</center>
- <table width="90%" align="center" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>不保存</td>
- <td><input type="button" value="Save" class="trans" onclick="Save()">
- <textarea rows="20" cols="50" id="output" class="txtedit"></textarea>
- </td>
- </tr>
- </table>
保存HTML中的Table到Excel中
转自:http://www.bcbbs.net/news/Content28841.aspx
- <html>
- <head>
- <title>保存HTML中的Table到Excel中</title>
- </head>
- <body>
- <h1>保存内容到Excel中</h1>
- <table id='content'>
- <tr><td>列1</td><td>列2</td></tr>
- <tr><td>a1</td><td>a2</td></tr>
- <tr><td>b1</td><td>b2</td></tr>
- <tr><td>c1</td><td>c2</td></tr>
- <tr><td>d1</td><td>d2</td></tr>
- <tr><td>e1</td><td>e2</td></tr>
- <tr><td>f1</td><td>f2</td></tr>
- </table>
- <a href="javascript:downloadfile('content')">保存文件</a>
- <script language="javascript">
- function downloadfile(id)
- {
- window.document.write(document.getElementById(id).outerHTML);
- window.document.execCommand("SaveAs",false,"C:\\download.xls");
- history.go(-1);
- }
- </script>
- </body>
- </html>
0 0
- 用js保存页面指定内容
- 用js保存页面指定内容
- 用js保存页面指定内容
- 用js保存页面指定内容
- Js打印页面指定内容
- js打印页面指定内容
- JS简单方法打印页面指定内容
- js打印页面指定区域内容
- 用JS刷新指定页面
- 用javascript拷贝保存页面控件内容
- js快捷键保存内容
- JS打印指定内容
- js 保存页面数据
- 不指定src, 用js生成 iFrame/新窗口 里面的内容(可用于scriptX打印部分页面等)
- 用js来刷新指定页面
- 用js来刷新指定页面
- js刷新指定页面
- 指定页面内容的打印
- 大数据时代下的用户洞察:用户画像建立(ppt版)
- Android屏幕适配全攻略(最权威的官方适配指导)
- delete和truncate的区别比较
- 杭电1012——u Calculate e(简单题)
- Swift高级开发语言--函数嵌套
- 用js保存页面指定内容
- Android酷炫实用的开源框架(UI框架)
- codeforces 551 D. GukiZ and Binary Operations
- StarUML Windows 版本破解
- asp.net传值方法汇总
- 论ios代理和协议
- 指定区域的图片自动按比例缩小的js代码(防止页面被图片撑破)
- 图片边缘增加光晕效果
- android动画- Property Animation(下)