Solve "the problem Jquery inside of each return failure"

Solve "the problem Jquery inside of each return failure"

Problem Description:

Centralized get some elements of the page, and then deal with these elements with each cycle, if one of the elements available, exit error, but the implementation of the time found that the code was executed after return

Baidu under, see reference article to know

Each code block in the original
return to false = BREAK
return ture = Continue
when the function returns to the entire return used in each, in fact, it only out of each loop

Solution:

By capturing throw try out wrong, to quit each, and return the wrong target!

Guess you like

Origin www.cnblogs.com/nlyangtong/p/11201748.html