When sending a request via AYAX, the script infinitely shows a loader.
I send request with such code.
$.ajax({ type: "POST", url: 'components/my/core.php', data: formNm.serialize(), success: function (data) { // Вывод текста результата отправки $(idusersendmessage).html(data); $("#content_"+formID).css('display', 'block'); $('#loader_' + formID).html(""); }, error: function (jqXHR, text, error) { // Вывод текста ошибки отправки $(idusersendmessage).html(data); $("#content_"+formID).css('display', 'block'); } });
In the core.php file itself there is an API call to another site. These requests are many, it happens that it takes 5 minutes to process. API requests themselves are executed here, but the Ajax returns nothing, and the loader is turned. Tell me how to solve this problem?