Y
Y
Yuri2016-04-12 20:44:34
1C-Bitrix
Yuri, 2016-04-12 20:44:34

Problem with catalog.element when loading by ajax?

Hello!
Bitrix 15.5.10
I do a quick view of the product in the list of products, by pressing the button the information should be loaded into the modal window, I marked the file /ajax/index.php in the directory

<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");?>
<?php
$arParams= $_SESSION['arParamsCatalog'];
//echo'<pre>';var_dump($arParams);die;
?>
<?$APPLICATION->IncludeComponent(
    "bitrix:catalog.element",
    "quick-view",
    array(
        "IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
        "IBLOCK_ID" => $arParams["IBLOCK_ID"],
        "ELEMENT_ID" => $_POST["id"],
        ....
$arParams['DETAIL_SET_VIEWED_IN_COMPONENT'] : '')
    ),
    false
);?>

html element view code is loaded, but js scripts are not loaded, and accordingly the photo slider, adding to the cart, etc. does not work.
How can I display html with scripts?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-04-13
@gangstarcj

js scripts are not sent by Ajax.

A
Alexander Filippenko, 2017-05-04
@alexfilus

Either inline, or Bitrix has built-in JS methods for loading scripts and styles. It's hell to deal with them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question