JavaScript与excel文件
1.<script type="text/javascript">
2.<!--
3.function saveCode(obj) {
4. var winname = window.open('', '_blank', 'top=10000');
5. var strHTML=document.all.tableExcel.innerHTML;
6. winname.document.open('text/html', 'replace');
7. winname.document.writeln(strHTML);winname.document.execCommand('saveas','','excel.xls');
8. winname.close();
9.}
10.-->
11.</script>
12.<div id="tableExcel"><table width="100%" border="0" cellspacing="0" cellpadding="4">
13.</table></div>
14.<input type="button" onClick="saveCode(tableExcel);">