Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Application.js Example #51

Closed
tomrossi7 opened this Issue · 4 comments

5 participants

@tomrossi7

Is this example really correct?

$('a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax('[data-pjax-container]');

I couldn't get it to work and looking around, it appears that what is passed to the .pjax method should actually be the link targets -- not the container? Am I missing something?

$(container).pjax( link, options )

Thanks,
Tom

@propercoil

This:
$('a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax('[data-pjax-container]');

is currently broken for me. i get:
Uncaught TypeError: Object [object Object] has no method 'pjax'

@chrokh

+1 for the poster.

In the readme-file, this line:

$('a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax('[data-pjax-container]');

...should read "the other way around", like so:

$('[data-pjax-container]').pjax('a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])');

The examples on https://github.com/defunkt/jquery-pjax seem to follow the second convention. Like so:
javascript $(container).pjax( link, options )

@hayksaakian

please update the documentation to reflect this. I was struggling to implement pjax_rails for several days, and I was about to put in an issue before reading this one.

@deiga deiga referenced this issue from a commit
@deiga deiga Update README.md
Fix for Issue #51
2d16b42
@deiga deiga referenced this issue
Closed

Update README.md #57

@deiga deiga referenced this issue from a commit
@deiga deiga Update README.md
Fix Issue #51
1c8302b
@route
Collaborator

Docs were updated

@route route closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.