Answer the question
In order to leave comments, you need to log in
How to cook ajax in Bitrix?
Good afternoon, I came across an article https://avivi.pro/blog/universalnaya-ajax-podgruzk... , a very interesting implementation of ajax in Bitrix components, but I can’t understand what sessions are used for:
$_SESSION[__CLASS__][$uniqueKey] = array(
'NAME' => $name,
'PARAMS' => $params,
'TEMPLATE' => $template
);
$component = Universal\Ajax::getComponent($uniqueKey);
...
$APPLICATION->IncludeComponent($component['NAME'], $component['TEMPLATE'], $component['PARAMS'], false);
$.ajax({
url: '/ajax/component.php',
type: 'post',
data: {
key: ComponentKey, // ключ компонента
name: list_data['NAME'], // имя компонента
template: list_data['TEMPLATE'], // имя шаблона
params: list_data['PARAMS'], //дополнительные параметры
},
success: function(data) {
$('#years').after(data);
}
});
$.ajax({src: '<?= $APPLICATION->GetCurPage() ?>'})
for obvious reasons
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question