for some reason it does not work, although everything seems to be written on manuals
<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); // $APPLICATION->SetTitle("AJAX"); CModule::IncludeModule('form'); function getmaps() { $err_mess = (CForm::err_mess())."<br>Function: GetByID<br>Line: "; global $DB; $strSql = " SELECT * FROM maps "; $res = $DB->Query($strSql, false, $err_mess.__LINE__); return $res; } $maps = getmaps(); echo json_encode($maps); // $APPLICATION->RestartBuffer(); ?> <? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php"); ?>