This question already has an answer here:
(这个问题已经在这里有了答案:)
I have some code:
(我有一些代码:)
$(xml).find("strengths").each(function() {
//Code
//How can i escape from this block based on a condition.
});
How can i escape from the "each" code block based on a condition?
(如何根据条件从“每个”代码块中退出?)
Update:(更新:)
What if we have something like this:
(如果我们有这样的事情怎么办:)
$(xml).find("strengths").each(function() {
$(this).each(function() {
//I want to break out from both each loops at the same time.
});
});
Is it possible to break out from both "each" functions from the inner "each" function?
(是否有可能从内部的“每个”功能中同时脱离这两个“每个”功能?)
# 19.03.2013
(#19.03.2013)
If you want to continue instead of break out
(如果您想继续而不是爆发)
return true;
ask by Tebo translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…