F
F
Franco Mannino2016-12-02 07:45:04
PHP
Franco Mannino, 2016-12-02 07:45:04

Display goods after sorting through ajax?

Bitrix. On the screen there are buttons for sorting by Name and Price, in each - in ascending and descending order. The problem is that after sorting, the page reloads completely, and the state of the buttons is reset to the original ones. Explain where to modify the code so that the rendered content is loaded via ajax and, accordingly, the page is not reloaded.

Where to read manuals about this understandable?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Sashnin, 2016-12-02
@garinov

For example, you have a form<form id="sort-form"></form>

$('#sort-form').on('submit', function(e){
  e.preventDefault();

  // Ваш код для отправки ajax-запроса
});

Read here -- https://api.jquery.com/event.preventdefault/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question