我有3个进程需要ajax来完成。但它是异步的,它无法完成我想做的事情..让我们说:functiona(param1,param2){$.post(...,function(result){if(result){b();}else{console.log("faileda");}})}functionb(){$.post(...,function(result){if(result){c();}else{console.log("failedb");}})}functionc(){$.post(...,function(result){if(result){console.log("su
我想从连接两点的数组中找到可能的选项。例如。$startPoint=1;$endPoint=5;$points=[[1,2],[2,3],[3,4],[4,5],[5,6],[6,5][4,3],[1,4],[1,3],[1,5],[1,6]];函数应该返回$possibleOptions=[[1,5],[[1,4],[4,5]],[[1,6],[6,5]],[[1,2],[2,3],[3,4],[4,5]]]最好添加一个可能的选项限制,例如。如果最多允许3种组合,则该函数将返回$possibleOptions=[[1,5],[[1,4],[4,5],[[1,6],[6,5]]如[[[