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

It doesn't work with the latest version of jquery-pjax #17

Closed
arjan0307 opened this issue Sep 24, 2012 · 6 comments
Closed

It doesn't work with the latest version of jquery-pjax #17

arjan0307 opened this issue Sep 24, 2012 · 6 comments

Comments

@arjan0307
Copy link

Hello, I followed the instructions as shown in the Railscast by Ryan Bates. http://railscasts.com/episodes/294-playing-with-pjax

Unfortunately it doesn't work anymore with the latest version of jquery-pjax. I checked this github page and see that you do the javascript call in a similar way as shown in the railscast.

This however leaves the links unaltered and when I click any of them the link gets followed through in a normal way. If I replace the jquery-pjax file with an older one. For example the one that was used in the railscast. Everything works as expected.

@charly
Copy link

charly commented Sep 26, 2012

Hi, same here rack-pjax : 0.6.0

@neersighted
Copy link

Pjax's API was changed for 1.0. It's now $(container).pjax(link), not $(link).pjax(container).

@charly
Copy link

charly commented Sep 26, 2012

@neersighted yes, saw that after posting here.
Actually it's $(container).pjax(link) if links are inside the container.
Otherwise $(document).pjax(container, links) will work, e.g pjax("#content", "#header ul.menu a")

@eval
Copy link
Owner

eval commented Sep 28, 2012

Nice. The sample app https://github.com/eval/rack-pjax/tree/sample-app now also reflects the new jquery-pjax usage.
Closing this one for now!

@eval eval closed this as completed Sep 28, 2012
@neersighted
Copy link

@charly

If I use $(document).pjax(container, links), (eg: $(document).pjax("[data-pjax-container]", "a")) I get this in the JS console:

Uncaught $.fn.pjax or $.pjax.click requires an anchor element 

@ashitvora-zz
Copy link

I think @charly made a typo.

Format is not $(document).pjax(container, links) but $(document).pjax(links, container)

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

No branches or pull requests

5 participants