【问题标题】:HTML code to download csv file for next day用于下载第二天的 csv 文件的 HTML 代码
【发布时间】:2016-09-11 04:25:26
【问题描述】:

您好,我正在尝试使用 html 编码从网页下载文件。 网页链接 =http://www.nrldc.org/WBS/injsch.aspx 如果我今天使用以下代码下载它,它工作正常。

<html>
<head>
    <title>view injection schedule</title>
</head>

<body onload=form1.submit()>
<form name="form1" method="post" action="http://www.nrldc.org/wbs/injsch.aspx" id="form1">
<div>

<input type="hidden" name ="__EVENTTARGET" id="__EVENTTARGET" value="download" />
<input type="hidden" name ="__EVENTARGUMENT" id="__EVENTARGUMENT" value="filename.csv" />
</div>

<script type="text/javascript">
//<![cdata[
var theform = document.forms['form1'];
if (!theform) {
     theform=document.form1;
}
function __dopostback(eventtarget,eventargument) {
if (!theform.onsubmit ||(theform.onsubmit() !=false)) {
theform.__eventtarget.value=eventtarget;
theform.__eventargument.value=eventargument;
theform.submit();
}
}
//]]>
</script>
</html>

现在在日期字段中,我想选择明天的日期,然后下载 csv 。我做不到。请提供任何帮助/建议。

【问题讨论】:

    标签: javascript html csv


    【解决方案1】:

    这可能对你有帮助:

    demo example

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-21
      • 1970-01-01
      相关资源
      最近更新 更多