Closed
Description
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
Labels
No labels