R
R
ragnar_ok2019-03-03 15:03:56
1C-Bitrix
ragnar_ok, 2019-03-03 15:03:56

Why header and footer are not displayed (bitrix:news + AJAX)?

I use bitrix:news in AJAX mode. On the same page I call the authorization form. Upon successful authorization, a page without a header and footer is displayed through the form. That is, only the area with the component is displayed. If you refresh the page, the header and footer are displayed successfully. Why is the header and footer not displayed?
Component call code:

<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");?>
<?if(!$USER->IsAuthorized() && $_GET["login"] == "yes"):?>
  <?$APPLICATION->IncludeComponent(
    "bitrix:system.auth.form",
    "",
    Array(
      "FORGOT_PASSWORD_URL" => "",
      "PROFILE_URL" => "",
      "REGISTER_URL" => "",
      "SHOW_ERRORS" => "Y"
    )
  );?>
<?else:?>
  <?$APPLICATION->IncludeComponent(
    "bitrix:news",
    "",
    array(
                        //... 
      "AJAX_MODE" => "Y"
    ),
    false
  );?>
<?endif?>
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
ragnar_ok, 2019-03-03
@ragnar_ok

I added an attribute onclick="void(0)"to the link to the authorization page, which was assigned BX.ajax.insertToNode.
Thus, I got rid of the method, and, therefore, the session ID in the parameters. Now the header and footer are connected.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question