标签:for log div 一个 pre 影响 function cti document
function exportExcel() { var encodeParam = function (json) { var tmps = []; for (var key in json) { tmps.push(key + ‘=‘ + json[key]); } return tmps.join(‘&‘); } var url = "请求地址" + encodeParam(form); console.log(url) //判断是否有id为_exportForm的form表单,如果没有则创建一个隐藏的form,把url放入,然后submit var exportForm = document.getElementById("_exportForm"); if (!exportForm) { exportForm = document.createElement("form"); exportForm.setAttribute(‘id‘, "_exportForm"); exportForm.setAttribute("action", url); exportForm.setAttribute("method", "post"); } document.body.appendChild(exportForm); exportForm.submit(); document.body.removeChild(exportForm);//导出成功后将form元素移除以免影响下一次导出 },
标签:for log div 一个 pre 影响 function cti document
原文地址:https://www.cnblogs.com/xuebiaikel/p/9366038.html