Answer the question
In order to leave comments, you need to log in
How to get code while running PHP on the front?
It is necessary to solve the problem associated with the Progressbar. How to get any text or numbers during PHP execution, for example, percentages separately until success.
$.ajax() and $.post() only return data at the end. $.ajax() has an xhr method. This method has progress, but how to get data at the time of pending I don’t understand how to get it.
That is, I need to get echo at the time of echo and not when everything is formed. How can I do that?
There is an idea, after all the checks, return AJAX and turn on the progressbar. Send a new AJAX to get the partial result and return again. And so send receive up to 100%. But that's just some kind of violence comes out over the server in my opinion.
Answer the question
In order to leave comments, you need to log in
Yes, full of instructions https://yandex.ru/search/?text=ajax+progress&lr=21...
That is, I need to get echo at the time of echo and not when everything is formed. How can I do that?
$state->setState("first state");
$storage->save($state);
// Отправить запрос на готовку заказа
// ...
// Ответ положительный
$state->setState("second state");
$storage->save($state);
// Найти курьера
// ...
// Курьер найден
$state->setState("first state");
$storage->save($state);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question