I am about to rip my hair of the head. I'm trying to interact with my PHP function, which is measuring some times: timeSince() a post is posted.
I do NOT need a plugin for doing this in jQuery, thanks :o)
But I wan't to run the $.get() on all .post-box-time div's so therefore I am using $.each. But it's only updating the last element, but giving me the result for the other divs to. -> It's like it's not doing the $.each()..
Here is my code:
setInterval(function() {
$('.post-box-time').each(function() {
var time = $(this).attr('data-time');
$this = $(this);
$.get("sys/calls.handler.php", { do: 'timeSince', data: time },
function(data){
$this.html(data);
});
}); // each function
}, 1000);