A
A
Alexey2020-05-03 17:47:16
PHP
Alexey, 2020-05-03 17:47:16

How to correctly issue an ajax request and display the result?

I am writing a parser that parses various information (pictures, text, fields, files). The first screen looks like just an input with a link pasted and a parse button.
When a button is clicked, I use ajax to send a request to the parse.php php file, which goes through the page and subpages and collects information.
The idea is this - when you click on the button, so that there would be no page reload - I just display: none forms and buttons, and then I need to load information according to the template (there is one template for pictures, another for fields and depends on the conditions).
How to do it more competently for further expansion of logic?
1. sew the parsing layout into the php file parse.php itself and get ajax html response?
2. sew layout into javascript?
3. how is it different?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2020-05-03
@xmoonlight

Depends on how you are going to work with the received data in the browser.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question