Okay, so what I'm trying to do is delete a row from my DB. Then update my list in html/php.
function deleteThis(blogid) {
var result="";
$.ajax({
url: 'deleter.php',
type: 'POST',
data: { id: blogid },
success:function(data) {
result = data;
alert(result);
}
});
if (result!=""){
$("#contentContainer").html(showAll("contentAllBlogs"));
};
};
Using this code (above), I am able to successfully delete data from my database. My problem is reloading the #contentContainer after the DB has been updated.
If I use setTimeout, and wait a few seconds before triggering this code (below)
$("#contentContainer").html(showAll("contentAllBlogs"));
It actually works, my list gets updated. But I don't want to use setTimeout. Is there a way to trigger this code after the DB is finished updating?
Please, help me. Thank you in advance.