如何通过Javascript修复CSV下载

时间:2019-05-16 05:03:58

标签: javascript

我正在尝试将报告从网页下载到excel/CSV中。虽然我能够将通过网页显示的数据下载到Excel中。但是,在Excel的末尾,每次都会插入以下垃圾行。

(function(a,m,i,g,o,s){o=a.createElement(g);s=a.getElementsByTagName(i)[0];o.src=m.origin+m.pathname+“/_t?eventType=CLOUDPAGESVISIT”;o.width=0;o.height=0;o.style.display=“none”;s.appendChild(o);})(document,window.location,“body”,“img”); if (_etmc && typeof _etmc.push === ‘function’) { _etmc.push([‘setOrgId’, ‘’]); _etmc.push([‘trackPageView’]); }

这是我用来将数据提取到excel中的代码:

<script runat=server>
   Platform.Load("core", "1");
   HTTPHeader.SetValue("content-disposition","attachment; 
   filename='DailyReport.csv'");
</script>

0 个答案:

没有答案