I have a javascript routine that gets a list of IDs and I want to open a browser tab for each ID. Here's what I have right now -- and it opens the first tab but not any other. Can someone point me in the right direction?
function launch() {
var data = {5, 8, 9};
if (data.length > 0) {
let url = "/Controller/Action";
data.forEach(function (entry) {
let link = document.createElement('a');
link.href = url + "?VisitID=" + entry;
link.target = '_blank';
link.click();
//setTimeout(() => { console.log("wait"); }, 1000);
});
}
else {
alert("You must select at least one row before launching");
}
}