Hi,
I implemented a thumpsup function in php. the view holds a thumpsup button and everytime the user clicks on it the db is updated. I am working with zend framework, so I have a url mypage.de/articles/thumpsup/id/x this url points to a specific acion/function in my articles conroller, but this function does not return any data, it just adds the thumpup to the database. there is another function list that passes content to the view.
so I am looking for a jquery function that executes the query url mypage.de/articles/thumpsup/id/x on click and then executes the list function to refresh the view.
$(document).ready(function() {
$("a.tp").click(thumpsUp);
});
function thumpsUp() {
var url = window.location.hostname + '/articles/thumpsup/id/'
+ $(this).attr('id');
$.post(url, {
"format" : "json"
}, function(data) {
....
}, 'html');
return false;
}
so the function thumpsup which I would normaly use to execute a url and update the view does not work here. any ideas how to solve that?