I'm adding/deleting dynamically items in my page "Items" with AJAX. But when I'm going to next page and then go back in my "Items", this collection is shown as it was before changing.
After F5-Refresh anything works.
How to avoid it? All is appropriate saved, but it looks like cache or smth like that.
Code sample:
<script>
delete_item_from_list = function (itemIdGiven, listIdGiven) {
$.ajax({
url: "@{Lists.deleteByIndexItem()}",
method: 'post',
async: true,
dataType: 'html',
data: {
itemId : itemIdGiven,
listId : listIdGiven
},
success: function(data) {
$(".items").html(data);
},
error: function() {
console.log ("It's a TRAP!");
}
});
};
</script>