js 导出Excel
2011-01-06 21:44
483 查看
JS方法:
<script type="text/javascript">
function excelPrint(objStr){
var tempStr = document.getElementById('sort_table').outerHTML;
var newWin = window.open();
newWin.document.write(tempStr);
newWin.document.close();
newWin.document.execCommand('saveas',true,objStr+'.xls');
newWin.window.close();
}
</script>
调用:
<input type="button" name="button2" value="导出EXCEL表格" onclick="excelPrint('13838325555,01月01日--01月25日详单');" style="cursor:hand"/>
<script type="text/javascript">
function excelPrint(objStr){
var tempStr = document.getElementById('sort_table').outerHTML;
var newWin = window.open();
newWin.document.write(tempStr);
newWin.document.close();
newWin.document.execCommand('saveas',true,objStr+'.xls');
newWin.window.close();
}
</script>
调用:
<input type="button" name="button2" value="导出EXCEL表格" onclick="excelPrint('13838325555,01月01日--01月25日详单');" style="cursor:hand"/>
相关文章推荐
- js把数据导出成excel的中文乱码问题解决
- js导出到excel的3种方法
- js导出Excel
- 小花 - JS导出Excel
- js 导出到excel
- 纯前端利用 js-xlsx 实现 Excel 文件导入导出功能示例
- Js 导出table内容到Excel的简单实例
- JS导出gridview到excel
- jquery.fileDownload.js插件导出excel 推荐
- JS兼容浏览器的导出Excel(CSV)文件的方法
- js导出EXCEL js导出EXCEL
- js页面上的excel导出
- js导出excel文件的简洁方法(推荐)
- ExtJS 给GridToExcel.js 添加分组GridPanel导出功能
- JS(十四)导出excel
- JS导出excel--2
- Js导出Excel
- 纯JS导出文件为excel格式-----1
- 纯js 解决页面table导出excel
- Js导出Excel