I have a table in my php file that is displayed using datatables. Upon clicking on a link in a row of the table, the database is updated using Jquery and GET AJAX. My database is getting updated, but table does not reflect the changes without a manual refresh. How do I make it possible, for the table values to reflect the changes immediately after the button is clicked. Code below:
$("#note").click(function(){
var note = prompt('Enter note');
if(note){
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
alert("Record updated");
}
};
xmlhttp.open("GET", "db_update.php?id="+id+"¬e="+note, true);
xmlhttp.send();
/* $.get("db_update.php", { id: id[$index], note:note }); */
}
return false;
});
Please advise.