Js controls the order in which ajax is executed, but occasionally returns out of order.

    $.ajax({
        data:{
            delayNum:$("-sharpajax-one").val(),
        },
        url: "/test/one.do?callback?",
        calback:"jsonp"+new Date().getTime(),
        type:"post",
        callback:"callback",
        dataType:"jsonp",
        success:function(data){
            console.log(data);
            alert(data.result);
            }
    }).then(
        function(){
            return $.ajax({
                data:{
                    delayNum:$("-sharpajax-two").val(),
                },
                calback:"jsonp"+new Date().getTime(),
                url:"/test/two.do?callback?",
                type:"post",
                dataType:"jsonp",
                success:function(data){
                    console.log(data);
                    alert(data.result);
                }
            });
        }
    ).then(
        function(){
            return $.ajax({
                data:{
                    delayNum:$("-sharpajax-three").val(),
                },
                calback:"jsonp"+new Date().getTime(),
                url:"/test/three.do?callback?",
                type:"post",
                dataType:"jsonp",
                success:function(data){
                    console.log(data);
                    alert(data.result);
                }
            });
        }
    )
Mar.06,2021

write it this way:

  

the third request should be written in the second then.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31d54-40e09.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31d54-40e09.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?