TypeError: Cannot read property 'debug' of undefined
at Object.Pjax.log (http://localhost:9000/bower_components/pjax/src/pjax.js:213:25)
at Object.Pjax.loadUrl (http://localhost:9000/bower_components/pjax/src/pjax.js:408:12)
at Scope.$scope.processForm (http://localhost:9000/scripts/controllers/getStartedController.js:11:22)
at http://localhost:9000/bower_components/angular/angular.js:10567:21
at http://localhost:9000/bower_components/angular/angular.js:18627:17
at Scope.$eval (http://localhost:9000/bower_components/angular/angular.js:12412:28)
at Scope.$apply (http://localhost:9000/bower_components/angular/angular.js:12510:23)
at HTMLFormElement.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:18626:21)
at HTMLFormElement.jQuery.event.dispatch (http://localhost:9000/bower_components/jquery/dist/jquery.js:4409:9)
at HTMLFormElement.elemData.handle (http://localhost:9000/bower_components/jquery/dist/jquery.js:4095:28) angular.js:9778
(anonymous function) angular.js:9778
(anonymous function) angular.js:7216
Scope.$apply angular.js:12512
(anonymous function) angular.js:18626
jQuery.event.dispatch jquery.js:4409
elemData.handle jquery.js:4095
I fixed this error by adding this.options = options to the very beginning of the loadUrl() function. However, after I fixed that error, I got a new error:
So with this second error, it falls back to the window.location() option, which is not the behavior that I am looking for. I have messed around with the code in order to fix this error but I have yet to find a solution.
Thanks for this great project!
I am attempting to implement a PJAX redirect with `Pjax.prototype.loadUrl()`. The actual code is
```
options = {
elements: ['a', '.pjax'],
selectors: ["#pjax"]
};
Pjax.prototype.loadUrl('/', options);
```
When I attempt to run call this, I get an error
```
TypeError: Cannot read property 'debug' of undefined
at Object.Pjax.log (http://localhost:9000/bower_components/pjax/src/pjax.js:213:25)
at Object.Pjax.loadUrl (http://localhost:9000/bower_components/pjax/src/pjax.js:408:12)
at Scope.$scope.processForm (http://localhost:9000/scripts/controllers/getStartedController.js:11:22)
at http://localhost:9000/bower_components/angular/angular.js:10567:21
at http://localhost:9000/bower_components/angular/angular.js:18627:17
at Scope.$eval (http://localhost:9000/bower_components/angular/angular.js:12412:28)
at Scope.$apply (http://localhost:9000/bower_components/angular/angular.js:12510:23)
at HTMLFormElement.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:18626:21)
at HTMLFormElement.jQuery.event.dispatch (http://localhost:9000/bower_components/jquery/dist/jquery.js:4409:9)
at HTMLFormElement.elemData.handle (http://localhost:9000/bower_components/jquery/dist/jquery.js:4095:28) angular.js:9778
(anonymous function) angular.js:9778
(anonymous function) angular.js:7216
Scope.$apply angular.js:12512
(anonymous function) angular.js:18626
jQuery.event.dispatch jquery.js:4409
elemData.handle jquery.js:4095
```
I fixed this error by adding `this.options = options` to the very beginning of the `loadUrl()` function. However, after I fixed that error, I got a new error:
```
Pjax switch fail:
TypeError {stack: (...), message: "Cannot read property '#pjax' of undefined"}
pjax.js:432
(anonymous function) pjax.js:432
request.onreadystatechange pjax.js:395
```
So with this second error, it falls back to the `window.location()` option, which is not the behavior that I am looking for. I have messed around with the code in order to fix this error but I have yet to find a solution.
After this you can eventually try (but I'm not sure this will work)
mypjax.loadUrl("/");
Oh.
You should use a Pjax instance. Not directly the prototype. Maybe you need to learn a little more JavaScript https://encrypted.google.com/search?hl=en&q=javascript%20prototype
See https://github.com/MoOx/pjax#new-pjax
``` js
var mypjax = new Pjax({
elements: ['a', '.pjax'],
selectors: ["#pjax"]
})
```
After this you can eventually try (but I'm not sure this will work)
``` js
mypjax.loadUrl("/");
```
Having the same issue, would be much better if the guide could cover this a bit. As it stands, I cannot get Pjax working at all using the readme document.
Having the same issue, would be much better if the guide could cover this a bit. As it stands, I cannot get Pjax working at all using the readme document.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Thanks for this great project!
I am attempting to implement a PJAX redirect with
Pjax.prototype.loadUrl(). The actual code isWhen I attempt to run call this, I get an error
I fixed this error by adding
this.options = optionsto the very beginning of theloadUrl()function. However, after I fixed that error, I got a new error:So with this second error, it falls back to the
window.location()option, which is not the behavior that I am looking for. I have messed around with the code in order to fix this error but I have yet to find a solution.Oh.
You should use a Pjax instance. Not directly the prototype. Maybe you need to learn a little more JavaScript https://encrypted.google.com/search?hl=en&q=javascript%20prototype
See https://github.com/MoOx/pjax#new-pjax
After this you can eventually try (but I'm not sure this will work)
Having the same issue, would be much better if the guide could cover this a bit. As it stands, I cannot get Pjax working at all using the readme document.
Please provide more informations so I can eventually help you. What code are you using ?