Answer the question
In order to leave comments, you need to log in
News filter using RestartBuffer does not work correctly. What could be the reason?
Good afternoon.
This is the first time I've encountered ajax content substitution, I've always done just get parameters in the url.
The problem is this:
1. before calling the news component, I wrote the following:
if ($_GET['_ajax'] == 'y') {
$GLOBALS['APPLICATION']->RestartBuffer();
}
if ($_GET['_ajax'] == 'y') {
die();
}
$('.portfolio--filter a').click(function(){
$('.portfolio--filter a').removeClass('active-link');
$(this).addClass('active-link');
let url = $(this).attr('href')+'?_ajax=y';
$.ajax({
url: url,
type: "GET",
success: function(response) {
$('#portfolio-wrapper').html(response);
},
error: function(jqXHR, textStatus, errorThrown){
console.log('Error: '+ errorThrown);
}
});
return false;
})
Answer the question
In order to leave comments, you need to log in
Try to substitute this flag in the component parameters so that it is taken into account in the cache key
'IS_AJAX' => $_GET['_ajax']
your component has already worked and cached, so the code is not re-executed
Why don't you want the Ajax mode built into Bitrix for components to use?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question