Issue when using loadUrl : Cannot read property 'requestOptions' #127

Closed
opened 2018-02-18 23:56:38 -05:00 by onemoreahmad · 1 comment
onemoreahmad commented 2018-02-18 23:56:38 -05:00 (Migrated from github.com)

Hi,
I'm using this lib with webpack, and everything work just fine. But when I try to use loadUrl() I got an error.

var pjax = new Pjax({
	elements: "a:not(.no-pjax)", // default is "a[href], form[action]"
	selectors: ["#content-container"]
});

pjax.loadUrl("/");

I got this error

Uncaught TypeError: Cannot read property 'requestOptions' of undefined
    at Pjax.loadUrl (app.js?v=1.27:sourcemap:13514)

I don't know if this is a bug or I'm missing some thing.
Thank you

Hi, I'm using this lib with webpack, and everything work just fine. But when I try to use loadUrl() I got an error. var pjax = new Pjax({ elements: "a:not(.no-pjax)", // default is "a[href], form[action]" selectors: ["#content-container"] }); pjax.loadUrl("/"); I got this error ``` Uncaught TypeError: Cannot read property 'requestOptions' of undefined at Pjax.loadUrl (app.js?v=1.27:sourcemap:13514) ``` I don't know if this is a bug or I'm missing some thing. Thank you
onemoreahmad commented 2018-02-19 00:06:38 -05:00 (Migrated from github.com)

With the help of the answer here
https://github.com/MoOx/pjax/issues/32#issuecomment-59639530

I managed to get it working by doing so :

   pjax.options.requestOptions = {}
   pjax.loadUrl('/', $.extend({}, pjax.options) )

Thanks.

With the help of the answer here https://github.com/MoOx/pjax/issues/32#issuecomment-59639530 I managed to get it working by doing so : ``` pjax.options.requestOptions = {} pjax.loadUrl('/', $.extend({}, pjax.options) ) ``` Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#127