I'm Currently building a polling app where real-time data are being pulled from the database.
I have figured out how to insert data into the database using Ajax without page refreshing but stuck on displaying those data in real-time without page refreshing using Ajax.
This is my code for inserting data:
$.ajax({
type: "POST",
url: "save.php",
data: {
color1: color1, color2: color2
},
success: function(data){
console.log(color2);
}
});
please help me in solving this problem. Thanks.