我正在尝试在满足条件后停止函数执行-但是,请继续获取错误
未捕获的SyntaxError:未定义标签'my_loop'
这是我的代码:
my_loop:
for (var i = 0; i < fatterkwslist.length; i++) {
console.log(fatterkwslist[i] + " " + "in your list");
(function (i) {
setTimeout(function() {
if (innerText === "Search blocked.") {
break my_loop;
} else {
document.querySelector(".result-disclaimer").innerText = "keywords checked" + " " + (i + 1) + "/" + fatterkwslist.length;
var history = {
"keyword": fatterkwslist[i],
"domain": domain,
"country": window.localStorage[RC.storageVars.country_url]
};
RC.queryHistory.push(history);
bgPage.RC.googleSearch.findPosition(fatterkwslist[i] ,
domain,
window.localStorage[RC.storageVars.country_url],
RC.renderResult);
RC.hideLoaded();
}}, 1000*i) }) (i);
};
不确定如何使setTimeout可见标签。
谢谢!