here is my code
$(document).on('click', '#global-search-button', function() {
$.pjax({
url: "http://localhost/project/brows",
container: '#pjax-container',
timeout: 9000000 ,
})
});
when i click on the button
her here is more info on request
Request URL: http://localhost/project/brows?_pjax=%23pjax-container
Referrer Policy: no-referrer-when-downgrade
Provisional headers are shown
Accept: text/html, */*; q=0.01
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost/project/brows
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
X-PJAX: true
X-PJAX-Container: #pjax-container
X-Requested-With: XMLHttpRequest
_pjax: #pjax-container
i have to add some more info to be able to post the question , so here it is
Often I had a similar problem because I included the hostname as well.
Try calling pjax without it like so
$.pjax({
url: "/project/brows",
container: '#pjax-container',
timeout: 9000000,
})
the reason was very simple and odd , basically if the href
of the link should be a #
it would cancel as soon as it fires .... i changed it to javascript:void(0)
and it worked
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With