迭代器

<!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>

 

posted @ 2018-07-04 08:45  二月花开  阅读(66)  评论(0编辑  收藏  举报