Z
Z
zlFast2016-05-05 15:19:48
JavaScript
zlFast, 2016-05-05 15:19:48

How to render data on the page from the model only after an ajax request?

Sending an ajax request

$.get("/ajax/getPeople?location="+locId, function(data) {
                    model.set("people", data.d);
                });

But I receive the data and fill the model after the response from the server comes and therefore the necessary data is not drawn on the page. How to make it so that only after the response has come from the server, the page is loaded and the data is rendered on it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AlexRas, 2016-05-05
@zlFast

$(document).ajaxComplete(function() {
    // Код
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question