<script language="javascript">
function exportExcel(atblData)
{
if (typeof(EXPORT_OBJECT)!="object")
{
document.body.insertAdjacentHTML("afterBegin","<OBJECT style='display:none' classid=clsid:0002E510-0000-0000-C000-000000000046 id=EXPORT_OBJECT></Object>");
}
with (EXPORT_OBJECT){
DataType = "HTMLData";
HTMLData =atblData.outerHTML;
try{
ActiveSheet.Export("C:\\ExportFile.xls",0);
alert('导出EXCEL文档完毕');
}
catch (e)
{
alert('导出Excel表失败,请确定已安装Excel2000(或更高版本),并且没打开同名xls文件');
}
}
}
</script>
<table
ID="tblData">
<tr> <td>姓名</td><td>年龄</td></tr>
<tr> <td>张三</td><td>18</td></tr>
<tr> <td>李四</td><td>33</td></tr>
</table>
上面这个只能导出到Excel2000的,2003等版本不能用,javascript我不懂,请帮看下,如何解决让其它版本也可以..