1、JS批量下載文件,用a標簽 download,只能下載最后一個2、 代碼:var a = document.createElement(“a”),//創(chuàng)建一個標簽 e = document.createEvent(“mouseevents”); //創(chuàng)建鼠標事件對象 e.initMouseEvent(“click”,false,false); //初始化事件對象 a.href = href; //設置下載地址 a.download = name; //設置下載文件名 a.dispatchevent(E); //給指定的元素,執(zhí)行事件單擊事件
JS批量下載文件,用a標簽 download,只能下載最后一個
冉冉說
2018-12-16 16:36:38