2

Is there a way to add extra parameters to YUI pjax calls, the only event handlers i found were like load, navigate and error. There we no handlers for before making the pjax call. Even i didn't found any help for this using Config Attributes of pjax calls.

Its like if default call is:

http://localhost:8000?pjax=1

and dynamic one added should be like:

http://localhost:8000?pjax=1&param=test

The value of param can change on calls.

Any help would be appreciated.. Thanks.

4

1 回答 1

3

The purpose of pjax is to provide enhanced navigation for capable browsers, as such, the links and parameters should be entirely clickable without any additional modification.

Any links in the source should already have the &param=test in the markup.

If you are adjusting the content of the markup via JavaScript, simply changing the link href should work fine. The selector (yui3-pjax) is bubbled, and the href will be parsed when the event is fired.

Rather than tying into the pjax event, as soon as you know what that link should be you should be doing the node.setAttribute('href', newLinkValue);.

This will ensure that when pjax is not available, the link still points the user to the right location.

于 2012-07-09T15:58:51.320 回答