Hey, i am making a survey using AJAX to send the votes. what below is the AJAX call and the html part for literally showing the votes.
$.ajax(address, {
type: 'POST',
data: {'votername' : votername,},
success: function (data) {
location.reload();
}});
<span>Votes:{{each.vote}}</span>
The idea is that after users click on the vote button, the vote count is going to increase by 1. I am reloading the page in order for the newest vote to show up. Is there any way that the latest vote can be shown not by reloading the page? it just “magically” pops up? Thank you in advance.
Try something like this…
Here your Ajax method should return the total number of votes.