迭代器
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>迭代器</title> </head> <body> <script type="text/javascript"> iterate(0); iterate(i){ if(i==20){ return; } $.ajax({ url:'', data:{}, async:false, success: function(data) { iterate(i+1) } }) } </script> </body> </html>