我已经写了一个脚本,它或多或少都会打开相同的链接,但会与另一个ID打开。循环中的变量是哪个。我的剧本其实是这样的,我只想知道我可以打开与变量此链接为ID:在循环中打开链接 - JavaScript
<!DOCTYPE html>
<html>
<body>
<button onclick="openLinks();">Click </button>
<script>
function openLinks() {
var i;
for (i = 150; i < 156; i++) {
window.open('http://www.ortner.elmima.at/wp-admin/admin.php?page=wpsl_store_editor&action=edit_store&store_id="i"'); //doesn't work, should print 150, 151...
}
}
</script>
</body>
</html>
在控制台试试这个:' “STORE_ID =” + 3' –
弹出式窗口拦截将阻止.... – epascarello
这是行不通的。不,弹出式窗口拦截器没有问题,我使用它作为个人用途,我停用了这个html网站的拦截器 –