Ajax success function

后端 未结 2 1468
慢半拍i
慢半拍i 2020-12-16 14:10

I am using an Ajax post to submit form data to the server, be validated and then return a message based on whether or not the data was valid and could be stored. My success

2条回答
  •  無奈伤痛
    2020-12-16 14:37

    The answer given above can't solve my problem.So I change async into false to get the alert message.

    jQuery.ajax({
                type:"post",
                dataType:"json",
                async: false,
                url: myAjax.ajaxurl,
                data: {action: 'submit_data', info: info},
                success: function(data) {
                    alert("Data was succesfully captured");
                },
            });
    

提交回复
热议问题