【发布时间】:2010-12-20 10:25:56
【问题描述】:
我有一些代码:
$(xml).find("strengths").each(function() {
//Code
//How can i escape from this block based on a condition.
});
如何根据条件从“每个”代码块中逃脱?
更新:
如果我们有这样的东西怎么办:
$(xml).find("strengths").each(function() {
$(this).each(function() {
//I want to break out from both each loops at the same time.
});
});
是否有可能从内部的“每个”函数中分离出两个“每个”函数?
# 19.03.2013
如果你想继续而不是爆发
return true;
【问题讨论】:
-
不是重复的。链接的问题是关于
$.each(),但这个问题是关于$().each,它们是两个不同的东西。 -
这是谷歌上用于该搜索的第二个链接。
标签: javascript jquery