O
O
ohwoow2022-04-11 15:11:52
Web development
ohwoow, 2022-04-11 15:11:52

How to load images on click?

There is a button and image names in the database, how to pull images from the database and insert them on the site by clicking on this button?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Olga, 2022-04-11
@Liatano

Use JS and apply AJAX. To do this, the server must have a file that, upon request with the image id, will return a link to the image. By clicking on the button, js initiates a request to the server, receives a response, inserts an image on the site.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question