efilatus2021-09-24 13:05:45
efilatus, 2021-09-24 13:05:45

AJAX in Bitrix, how to use it?

BX.AJAX - after half a day of studying this topic, I realized that I did not fully understand his work.


  1. some components and modules will have their own ajax that can be requested using BX.ajax.runComponentAction
  2. you can also create ajax classes in your component and module and call them using the same method
  3. files must be created in the root of the component/module under the name class/ajax, and the methods must be named with the postscript Action

Didn't understand:
  1. how to create your own ajax requests for existing components, so as not to get into the bitrix folder and do it in the local folder (and is it possible)
  2. what is better to use BX.ajax or $.ajax, is there any particular difference between them
  3. using ajax outside of a component/module, how to do it, just create a php file with the methods and data that I need to get, or is it done somehow in a special way (I want to understand how professionals do it)

There is also an example of a task that I need to solve using ajax, and if it would not be difficult to describe a little how it could be solved
: site header, so that a person can see in advance how many goods he has

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question