S
S
Sergey Beloventsev2018-01-19 11:56:21
Solid State Drives
Sergey Beloventsev, 2018-01-19 11:56:21

Why is the pjax container not reloading?

This is how I try to update pjax

$(document).on('click', '.card.card-product .footer .add-product', function () {
    var obj = $(this);
    var id = obj.data('id');
    obj.attr("disabled", true);
    $.ajax({
        method: "POST",
        url: "add",
        cache: false,
        data: {id: id, count: 1},
        success: function (data) {
            $.pjax.reload({container: "#pjax-basket-panel", timeout: false});
            $.pjax.reload({container: "#pjax-product-panel", timeout: false});
            toggleButton(obj);
            obj.attr("disabled", false);
        },
        error: function (data) {},
    });
});

the bottom line is this $.pjax.reload({container: "#pjax-product-panel", timeout: false}); overloads pjax , but this one doesn't. Why don't you tell me.
And if you comment out the bottom line, then everything works.
In this case, the status of the first request is canceled

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