我有以下 jQuery 循环,但在每个循环动作中我都有用户交互,代码应该等到用户交互完成。是否有可能暂停循环,或者是否有其他可能实现它?
jQuery.each([345, 897, 345 /* ... */], function(index, value) {
// User interaction, need to wait the user finishing/answer
// Here is a jQuery UI dialog with an input field in it
// After the user entered their value and hit the submit button
// which fires an own callback which could also continue the loop somehow?
});