falsandtru / pjax-api

The advanced PJAX superior to SPA.
https://falsandtru.github.io/pjax-api/
Apache License 2.0
318 stars 28 forks source link

Ajax POST method become GET #43

Closed ljfreelancer88 closed 4 years ago

ljfreelancer88 commented 4 years ago

I have a link which deletes a record and I'm using Ajax & POST method. But PJAX "converted" it to GET method. Is there any way to tell PJAX in the API to exclude elements?

This is the simple code.

<a href="...">delete</a><!-- This link trigged by POST method AJAX -->

<div class="card-body">
<div id="pjax-container">
...content
</div>
</div>

new Pjax({
  areas: [
    '.card-body',
    '#pjax-container'
  ]
});
falsandtru commented 4 years ago

Use link or filter option. But anyway anchor links don't support non-idempotent methods.