Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何改变';另存为类型';在Internet Explorer中使用jQuery将html表导出到excel时,是否将对话框的.xls设置为?_Jquery_Jquery Plugins - Fatal编程技术网

如何改变';另存为类型';在Internet Explorer中使用jQuery将html表导出到excel时,是否将对话框的.xls设置为?

如何改变';另存为类型';在Internet Explorer中使用jQuery将html表导出到excel时,是否将对话框的.xls设置为?,jquery,jquery-plugins,Jquery,Jquery Plugins,在上面的代码中,当显示对话框时,另存为类型中没有.xls。 因此,请告诉我.xls“另存为”类型是如何在外接程序下拉列表中显示的我同意@Rorymcrossan-客户端脚本编写不会影响浏览器的“另存为”对话框 如果希望用户看到该文件类型,当用户单击超链接时,应向服务器发出请求。然后,在服务器上,您必须生成.xls文件(或内存中的filestream),并使用头中提到的application/vnd.ms-excel位将响应发送回 下面是它的样子:()我不相信您可以通过JS.Rory McCros

在上面的代码中,当显示对话框时,另存为类型中没有.xls。
因此,请告诉我.xls“另存为”类型是如何在外接程序下拉列表中显示的

我同意@Rorymcrossan-客户端脚本编写不会影响浏览器的“另存为”对话框

如果希望用户看到该文件类型,当用户单击超链接时,应向服务器发出请求。然后,在服务器上,您必须生成.xls文件(或内存中的filestream),并使用头中提到的application/vnd.ms-excel位将响应发送回


下面是它的样子:()

我不相信您可以通过JS.Rory McCrossan设置“另存为”对话框的文件类型选项,是吗?
// If Internet Explorer
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
    txtArea1.document.open("txt/html", "replace");
    txtArea1.document.write(tab_text);
    txtArea1.document.close();
    txtArea1.focus();
    sa = txtArea1.document.execCommand("SaveAs", true, tableid + fileNo + ".xls");
}
else
    sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));

return (sa);