Answer the question
In order to leave comments, you need to log in
Bitrix fall off JS events on the site?
Good day to all! A number of buttons with the same handler do not work on the site . If you go to the code inspector, you can see that there are no events on these buttons:
At the same time, if you clear the cache on the site, everything starts working and events are again hung on the buttons:
but exactly until the page is reloaded, then everything falls off again.
The handler script is cut directly in the template via Asset::getInstance()->addJs, and after the first load it stops loading.
I thought about the composite, but disabling it on the site did not lead to a correction of the situation. Pliz tell me what could be wrong?!??
Thank you all in advance)
Answer the question
In order to leave comments, you need to log in
As already noted by no_one_safe - using "Asset::getInstance()->addJs" is only useful in those parts of the code that are not subject to any kind of caching. Use the component_epilog.php of your component. In the JS component itself, the code is connected using the "addExternalJs" method. Link to bitrix info Click
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question