Hello again,
I've discovered something interesting. I'm using ajax in a carousel structure to add more items to the end when needed. And it seems to work just fine.
This would be the ajax call inside a function called ItemLoad():
$.ajax({
type: "POST",
url: ajax_url,
data: args,
success: function(resp){
$('#dumpster').append(resp);
}
});
Another function calls ItemLoad() when the carousel has reached it's end
itemLoad();
$slider.ajaxComplete( function() {
console.log("ajaxdone");
//items get inserted into the DOM
});
When I run this, I get one "ajaxdone" at the first request, then two at the second, then three... basicly the ajaxComplete events stack up or something so the code runs to many times instead of just one.
WHat am I missing?