My Ajax post request updates the HTML on success function, but it disappears after complete function.
Here is my Ajax request:
$.ajax({
type: 'POST',
url: 'http://api.open-notify.org/astros.json',
dataType: 'json',
async: false,
dataType: 'json',
success: (data) => {
alert(data.Title)
$("#final").append("Success")
},
error: (data) => {
$("#final").append("error")
}, complete: () => {
$("#final").append("#################")
alert("complete")
},
timeout: 3000
});
What changes should be made to make sure updated html code is shown?