0
Web sitemdeki yayınlara ajax geriçağırımını kullanarak oylamayı uygulamaya çalışıyorum ama bunu yapabilir mi? Düğmeye bastığımda ajax işlevinin çağrılmadığını buldum.Lütfen herhangi bir yardım Ben hata yaptım nerede anlamaya bana? Bu ajax geri arama kullanıyorum ilk kez.ajax kullanarak oylama uygulama
<td>
<button data-direction="down">-</button>
</td>
<td><span class='votes'>{{=recipe.votes}}</span></td>
<td>
<button data-direction="up">+</button>
</td>
<td>
<strong>{{=A("comments",_href=URL('view_posts',args=recipe.id))}},{{=recipe.name}}</strong>
</td>
<script>
function do_ajax_vote(t.direction) {
alert("clicked");
}
jQuery(function() {
jQuery('[data-direction=up').click(function() {
do_ajax_vote(this,'up');
});
jQuery('[data-direction=down').click(function() {
do_ajax_vote(this,'down');
});
});
</script>