B
B
bro-dev2016-03-06 01:17:32
JavaScript
bro-dev, 2016-03-06 01:17:32

Is it possible to set up pjax on wordpress without changing the backend?

As I understand it, this library simply receives the page by url, and replaces the block with the same selector from the new one on the current page. If this is true, then the back end can be left alone if it works well without ajax.
The problem is that I keep getting out.

XHR failed loading: GET

Although if you manually follow the link, then all the rules are loaded, then what you need.
If without ajax I just hung up a submit on form changes, now I hung up pjax like this
$.pjax({url:"http://localhost/?" + $('.filter form').serialize(), container: '#pjax-container'});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bro-dev, 2016-03-18
@xPomaHx

In general, you can, this library has a default timeout that is simply not working. and when in half a second he does not receive the page, he loads it in the usual way, I could not catch this behavior. Set a timeout of 10 seconds, even on localhost I can’t make it work with the standard. Mb is still a matter of the openserver.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question