Closed georgehristov closed 4 years ago
Probably you should call event.preventDefault().
Tried it put it did not work as expected. And in any case it is better for have the pjax:click and pjax:clicked events to prevent even sending the request to the server
I don't provide such events. You have to call that method to disable events in capture phase. This pjax ignores disabled events. I designed event canceling in this way.
However, anyway there is no way to prevent browser back/forward without handling beforeunload events. And since pjax usually disables browser functions to keep form data, I don't use pjax with form pages and I recommend that pjax users do so.
Have you considered adding more events to the list (as in defunkt/jquery-pjax)? Is there a way to prevent request in case some conditions not met? For instance a dirty form not saved.