首页 > 代码库 > js打开新的链接下载文件

js打开新的链接下载文件

var p =params.join("&");var a = document.createElement(‘a‘);a.href = ‘report/exportpubcount.do‘+p;a.target = ‘_blank‘;a.id=‘exppub‘;document.body.appendChild(a);var alink = document.getElementById(‘exppub‘);alink.click();alink.parentNode.removeChild(a);