P
P
po4emu4ka20202021-06-10 06:47:24
1C-Bitrix
po4emu4ka2020, 2021-06-10 06:47:24

How to fix a subscription to products (which are out of stock) that are loaded via AJAX?

Hello colleagues!
Please tell me how to solve this problem: I have a list of products with loading via ajax on button click. So, if I load products via ajax and among them there is such a product that is not available, then when you click on the "Subscribe" button, nothing happens.
As far as I was able to find out, all this is because the js script of the component that is responsible for the subscription does not work. I have an idea that it is possible to solve the problem by re-initializing this script, but I do not understand HOW to do this. Tell me, please, how to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
scottparker, 2021-06-10
@scottparker

try to hang a click handler on the button on the document

$(document).on('click', 'селектор_кнопки', function(e){
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question