如何使用 window.open 和 for 循环在 Chrome 中打开多次新选项卡?
示例:
const openFollowedProfiles = () => {
for (const profile of store.followed){
console.log(profile)
window.open(profile, '_blank');
}
};
最佳答案
出于安全原因,您无法同时打开多个窗口。
每次您想要创建新窗口时,您都必须获取用户与网站的交互(例如“点击”事件)。
关于javascript - JS如何循环多次打开新标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61163531/