function postExcelFile(params, url) { //params是post请求需要的参数,url是请求url地址 var form = document.createElement("form"); form.style.display = 'none'; form.action = url; form.method = "post"; document.body.appendChild(form); for(var key in params){ var input = document.createElement("input"); input.type = "hidden"; input.name = key; input.value = params[key]; form.appendChild(input); } form.submit(); form.remove(); }