S
S
Stepan Gervik2019-09-26 18:39:02
AJAX
Stepan Gervik, 2019-09-26 18:39:02

How to do multiple output in AJAX?

Well, in general, I figured out AJAX at the hello word level, and a question appeared. For example, I have a button with AJAX and when I click it, I would normally get just the response given to me by the page. But what if I want the page to tell me its status when performing each operation from the set.
I click on the "add data" button and somewhere on the main page I get info in the form of a log:
-> connecting to the database
-> entering data
-> successfully!

How can I implement this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AUser0, 2019-09-26
@AUser0

Return from AJAX not "just a response", but "an array of just responses in JSON format", that's all, as easy as shelling pears.

A
Anton Neverov, 2019-09-26
@TTATPuOT

Use JSON arrays.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question