I'm working with codeigntier and i'm trying some stuff with ajax
. This is somewhat difficult to explain.
I have a controller Products with a method "overview", and a view "products_overview".
My problem is, is when I make the ajax call in the view in this part:
$('body').delegate('#notification-close', 'click', function(){
$('#notification').fadeOut(200, function(){
$('#notification').remove();
});
$('#blanket').fadeOut(200).remove();
$.ajax({
type: 'GET',
url: '<?php echo $current_get_url; ?>',
success : function (result) {
$('#column-middle').html(result);
}
});
});
It doubles the ajax call everytime i use it. And something else. The products controller creates pagination links. When I go back and forth a few times, I also make ajax calls. Let's say I do that 4 times. Then, when I use the above ajax call, it will execute those 4 previous calls and then start doubling from that!
So, i'm kind of lost here. When I put a setTimeout
on $('#column-middle').html(result)
, it will execute once, but then give a jQuery
error that "result" is not defined.