S
S
suzyry2016-02-05 19:12:22
JavaScript
suzyry, 2016-02-05 19:12:22

Why does pjax only allow one ajax request?

Good day to all.

Connected pjax in yii2. Everything works great.
But absolutely any ajax requests to some address pass only once.

Only such a crutch helps:

$.ajax({
    url: "/"+url+"?key="+Date.now(),
    //other code
})

That is, specify a different address each time.

The point is in pjax, since such restrictions are absent on those pages where pjax is not connected.

Thank you for your attention!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2016-02-05
@suzyry

pjax apparently caches the result of each request, and if the url is the same, the request is not resubmitted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question