Window.location.href =” link address “in JavaScript code, but if you want to open multiple links at the same time, using the for loop window.location.href =” link address” will not work. The loop cannot continue because it opens a window. The following HTML code can be downloaded in bulk:

Function downloadAllFile() {var selectIds = $.common.isempty ($.table._option.id)? $.table.selectFirstColumns() : $.table.selectColumns($.table._option.id); If (selectIds = = null | | selectIds. Length = = 0) {$. Modal. AlertWarning (" please select at least one record "); return; } let triggerDelay = 100; let removeDelay = 1000; $.each(selectIds, function (i,fileId) { download(fileId, triggerDelay, removeDelay); }); } function download(fileId,triggerDelay, removeDelay) {setTimeout() {// add iframe, set SRC, Var frame = $('<iframe style="display: none; class="multi-download"></iframe>'); Attr (' SRC ', prefix+ 'downloadFile/? id=' + fileId); $(document.body).after(frame); setTimeout(function() { frame.remove(); }, removeDelay); }, triggerDelay); } </script>Copy the code

Make a little progress every day and share every piece of knowledge