【发布时间】:2014-07-10 16:10:21
【问题描述】:
<script>
$(document).ready(function(){
$("#btnExport").click(function(e) {
window.open('data:application/vnd.ms-excel,' + $('#dvDatatable').html());
e.preventDefault();
});
});
</script>
这是我用来导出我的 html 表的代码,其中 #btnExport 是我的导出按钮 '#dvDatatable' 是我的表 id。但这段代码对我不起作用。 它只是像简单文件一样下载
我必须对我的代码进行哪些更改?
【问题讨论】:
-
它只是像简单文件一样下载....以 xls 格式或文本格式。
-
下载为文本文件
标签: jquery html jquery-plugins export-to-excel