これが私のAjax呼び出しです:
$.ajax({
type: "POST",
url: "ProductDetail.aspx/AddCart",
data: '{productId:' + 4 + ',productTypeId:' + 0 + ',quantity:' + 1 + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function () {
alert('successful');
refreshCart();
},
complete: function () {
alert('Completed');
refreshCart();
}
});
alert('Completed') が表示されてから webmethod 関数に移動しますが、サーバー側のコードが完了した後に必要になります。何か提案はありますか?