request bitti, şimdi ajax metodu success dönerse dönen değere göre +(true) yada -(false) olarak nitelendirdim, jQuery'nin load metodu ile partial refresh yaptırın değiştirmek istediğiniz div yada span her ne özellik içinde ise değer.
Bunun standart senaryosu budur.
Teknik taraflı sadece pseudo kod yazabilirim.
a onclick="calculate(1)"
<script>
function calculate(val)
{
dataString =parseInt(val);
$.ajax({
type: "POST",
url: "action.php",
data: dataString,
dataType: "json",
success: function(data) {
if(data[0]==false){
$('#refreshDiv').fadeIn(100).html("-1");
} else if(data[0]==true){
$('#refreshDiv').fadeIn(200).html(" +1");
}
},
error:function (xhr, ajaxOptions, thrownError){
$('#refreshDiv').fadeIn(100).html("Hata olustu!");
}
});
}
</script>
basit bir tutorial.