Question: Doesn't this library have the feature that invoke manual pjax? #130

Closed
opened 2018-02-26 21:45:23 -05:00 by venzersiz · 7 comments
venzersiz commented 2018-02-26 21:45:23 -05:00 (Migrated from github.com)

Hi, I'm using defunkt/jquery-pjax. but this library has bug. Then I am replacing spa library.

I read the document fully. But I can't find that feature. Would you help me?

Hi, I'm using defunkt/jquery-pjax. but this library has bug. Then I am replacing spa library. I read the document fully. But I can't find that feature. Would you help me?
BehindTheMath commented 2018-02-26 22:46:42 -05:00 (Migrated from github.com)

You can use pjax.loadUrl().

You can use `pjax.loadUrl()`.
venzersiz commented 2018-02-27 00:17:59 -05:00 (Migrated from github.com)

@BehindTheMath Thank you! But that method have two parameters. How do I set 'options' parameter? If only 'href' parameter set, error occurred.

Would you guide me the document or code example?

@BehindTheMath Thank you! But that method have two parameters. How do I set 'options' parameter? If only 'href' parameter set, error occurred. Would you guide me the document or code example?
BehindTheMath commented 2018-02-27 01:15:43 -05:00 (Migrated from github.com)

The second parameter is an options object. You can pass in pjax.options, but you will need to make sure options.requestOptions exists. For example:

if (!pjax.options.requestOptions) {
    pjax.options.requestOptions = {};
}
pjax.loadUrl(href, pjax.options);
The second parameter is an options object. You can pass in `pjax.options`, but you will need to make sure `options.requestOptions` exists. For example: if (!pjax.options.requestOptions) { pjax.options.requestOptions = {}; } pjax.loadUrl(href, pjax.options);
BehindTheMath commented 2018-02-27 01:17:30 -05:00 (Migrated from github.com)

@robinnorth What do you think about falling back to this.options if the options parameter is not set, as well as setting options.requestOptions = {} in parseOptions()? This way, pjax.loadUrl(href) will just work out of the box.

@robinnorth What do you think about falling back to `this.options` if the options parameter is not set, as well as setting `options.requestOptions = {}` in `parseOptions()`? This way, `pjax.loadUrl(href)` will just work out of the box.
venzersiz commented 2018-02-27 01:30:46 -05:00 (Migrated from github.com)

@BehindTheMath Thank you very much!

@BehindTheMath Thank you very much!
BehindTheMath commented 2018-02-27 11:05:42 -05:00 (Migrated from github.com)

Related: #127

Related: #127
robinnorth commented 2018-02-28 11:14:17 -05:00 (Migrated from github.com)

@BehindTheMath yes, that sounds good to me. Per my comment in #129, I think options.requestOptions should be split out into a separate property that is just handled internally by the library.

@BehindTheMath yes, that sounds good to me. Per my comment in #129, I think `options.requestOptions` should be split out into a separate property that is just handled internally by the library.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#130