Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme example error #13

Closed
benjamingeorge opened this issue Aug 10, 2014 · 4 comments
Closed

Readme example error #13

benjamingeorge opened this issue Aug 10, 2014 · 4 comments
Assignees
Labels

Comments

@benjamingeorge
Copy link

When I try to implement the demo in the readme (sideBySide switch) I get an error.

Pjax switch fail:  ReferenceError {stack: (...), message: "forEach is not defined"}
 pjax.js:431
(anonymous function) pjax.js:431
request.onreadystatechange

This error only happens with using sideBySide switch

switches: {
            ".js-Pjax": Pjax.switches.sideBySide
          }

using outerHtml or innerHtml does not throw this error. I'm using the latest Chrome browser.

@MoOx
Copy link
Owner

MoOx commented Aug 10, 2014

Sorry for that bug, I'm working on a branch to test the entire library but right now I'm focused on something else.

I think I found the bug here.

Can you try adding var forEach = Array.prototype.forEach in the global scope & confirm me that this snippet fix this bug ?

@benjamingeorge
Copy link
Author

that fixed the undefined error but now I'm getting:
Pjax switch fail: TypeError {stack: (...), message: "Cannot read property 'callbacks' of undefined"}

@MoOx
Copy link
Owner

MoOx commented Aug 10, 2014

I published that part without any serious tests :/

Here is how I'm using pjax v0.1.x https://github.com/MoOx/moox.github.io/blob/147ccd6ff5cf6768d0dd8b4131581203055e10ff/src/assets/_scripts/vanilla.js#L47-L84

This should help you to get necessary stuff.

For the styles, here is what I'm using https://github.com/MoOx/moox.github.io/blob/24e851a8f5d7c2fe7559c4d19642aa25c4394708/src/assets/_styles/partials/_animation.scss

@MoOx MoOx self-assigned this Aug 13, 2014
@MoOx MoOx closed this as completed in ce28c1a Oct 14, 2014
@MoOx
Copy link
Owner

MoOx commented Oct 14, 2014

Fixes should be available in 0.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants