Issue on Using complte and done Events on loading Content After Loading Indicator
Can you please take a look at
This Demo and let me know why I am not able to load new content to the #result on .done() event. Basically what I want to do is
1- Send a Request to server to load Some data
2- Load loading indicator Until getting all Data (which I used beforeSend and complete here)
3- Apply data processing in .done()
but for what ever reason which I cant figure it out the .done() is not functioning!
- $("#change").on("click", function () {
var req = $.ajax({
type: "POST",
url: "datapro.php",
beforeSend: function () {
$("#wait").css("display", "block");
},
complete: function () {
$("#wait").css("display", "none");
}
});
req.done(function (data) {
//do something
$("#result").html("Hi, This is New Content");
});
});
Thanks