B
B
Baffer2019-02-23 12:57:50
AJAX
Baffer, 2019-02-23 12:57:50

How to dynamically update a block using Ajax?

there is something like this:

$(document).ready(function (e) {
                        $(".epict").on('submit',(function(e) {
                            e.preventDefault();
                            $.ajax({
                                url: "epict",
                                type: "POST",
                                data:  new FormData(this),
                                contentType: false,
                                cache: false,
                                processData:false,
                            success: function(response)
                            {
                                $(".pict").html(response);
                            }        
                           });
                        }));
                    });

Image update. The picture is loading. No problem. But after a successful upload, it is not displayed in the block.
Only after the page is refreshed does it change to a new one (which has been loaded).

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question