如何从客户端下载Internet Explorer中CSV格式的表行?目前我正在使用下面的URI方法在其他浏览器中下载它。但似乎Internet Explorer不支持以下机制。我想从IE版本8开始支持,直到最新版本。对IE的任何帮助都将不胜感激。
   var fileName = "Result"; 
   var uri = 'data:text/csv;charset=utf-8,' + escape(CSV);
   var link = document.createElement("a");    
   link.href = uri;
   link.style = "visibility:hidden";
   link.download = fileName + ".csv";
   document.body.appendChild(link);
   link.click();
   document.body.removeChild(link);发布于 2014-11-12 20:12:06
我得到了它的解决方案,那就是为我支持IE 8+。我们需要指定分隔符,如下所示。
if (navigator.appName == "Microsoft Internet Explorer") {    
    var oWin = window.open();
    oWin.document.write('sep=,\r\n' + CSV);
    oWin.document.close();
    oWin.document.execCommand('SaveAs', true, fileName + ".csv");
    oWin.close();
  }  您可以通过链接http://andrew-b.com/view/article/44
https://stackoverflow.com/questions/26858107
复制相似问题