Skip to content

Cancel does not work #519

Closed
Closed
@Arwany

Description

@Arwany

Hi,

I am trying to cancel the request if some conditions are not met, but it seems that it is not preventing the action, any ideas?

I wrote the following:

$(document).pjax('a', 'container', {maxCacheLength: 0, replace: true, scrollTo: 0});

$(document).on('pjax:click', function () {
        //console.log('Saving: ' + saving + ', Loading: ' + loading);
        if ( !condition ) {
            console.log('Stopping the loading...');
            event.preventDefault();
        }
});

The code above seems to continue to load the clicked link and put its content in the container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions