js批量下载

废话不多说

  var doc = ['下载的url','下载的url2'];
 for (i = 0; i < doc.length; i++) {
            console.log(doc[i])
            window.open(doc[i], '_blank');
        }

代码部分就这么多,另外需要设置浏览器
js批量下载

仅有 1 条评论
  1. AutoDown #ta { width: 100%; height: 350px } 批量下载 $(function () { var node = $('#ta').val('') var initid; var newnode; var i=0; // function trim(vStr) { return vStr.replace(/(^\s+)|(\s+$)/g, ""); } $('#btn').click(function () { var node = $('#ta').val() node.replace(/(^\s+)|(\s+$)/g, "") newnode = node.split(',') console.log(newnode) godown() }) function godown() { initid = setInterval(gourl, 5000); } function gourl() { if(i==newnode.length){ stopinitid() }else{ console.log(newnode[i]) window.open(newnode[i], '_blank'); i++; } } function stopinitid() { clearInterval(initid); } })

    jcomey July 7th, 2020 at 10:10 pm回复
来都来了,留个言吧🙂