form导出excel

var obj={
     
	clearDateStart :'2019-11-25',
	clearDateEnd  :'2019-11-26'
}
var form = document.createElement("form");
form.style.display = 'none';
form.action = "http://xxxx:9001/outside/road/clear/summarize/export";
form.method = "post";
document.body.appendChild(form);
for (var key in obj) {
     
    var input = document.createElement("input");
    input.type = "hidden";
    input.name = key;
    input.value = obj[key];
    form.appendChild(input);
}
form.submit();
form.remove();
return false

你可能感兴趣的:(js)