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
pjax broken? #182
Comments
Try to replace(you have typo error): $("a.pjax").pjax("#main" }); with: $("a.pjax").pjax({ container: "#main" }); |
Thanks for the response mirzadelic! Unfortunately, it is still not working :/ console is logging "true" in regards to $.support.pjax
|
Wrap this text from second.html in div, and then try. and then: $("a.pjax").pjax({ container: "#main" , fragment: "#main" }); |
Still nothing :/ Thanks for taking the time to help! index.html
second.html Bacon ipsum dolor sit amet strip steak short ribs jowl pork loin tri-tip, meatball bacon andouille. Biltong swine spare ribs, pork chop turducken pancetta ball tip brisket turkey tenderloin. Chicken corned beef bresaola drumstick boudin pancetta. Pastrami short loin ball tip venison turducken. Flank shankle ham hock ribeye bacon sausage jowl meatloaf turkey tail fatback. Jerky meatloaf venison cow tri-tip, shoulder bacon hamburger ham pork chop.
`
|
Fixed! Had to be running on an actual server...? Thanks for your help @mirzadelic !! |
It doesn't work on localhost ? |
I was running it through general html files as opposed to using my localhost (that was the issue). However, I don't know that I understand the fragment option... Can fragment be declared as any element on the page that needs to be loaded - or does it have to be the same as the main container element? ex:
The above doesn't work for me. In order for it to work, I have to put:
|
It doesn't need to be the same div, if you can load any element to that #main: $('a.pjax').pjax({ container: '#main', fragment: '#differentContainer' }); pjax will find #differentContainer and put all it contents in current #main div. |
I have that set up to work, and it "changes" to the next page, but no content loads into the #main container. I've even tried setting ajax to not cache, still empty #main. |
You need to have #differentContainer on next page, so it will take content from that div and put it in #main. |
I can! Thanks!! second.html
index.html
|
You need to wrap text from #shim in div:
This works to me.. |
BOOM! Worked! Looks like in order to return a response, the content needs to be wrapped by an element within the fragment div. So, Bacon ipsum.... works, as does Bacon ipsum.... Thanks @mirzadelic !!! |
I'm glad that it works. :) |
So initially I tried doing this thing with WordPress, with no dice. In response, I tried doing it with basic HTML & JS.
Still no dice.
index is the main page, has one anchor that links to third.html (which is just plain text).
As you can see below, I am putting a timestamp within the h1 so that I can verify that the pjaxy goodness works.
However, I can't get it to work.
I've also tried another file, second.html, that had full html / head tags and the text within a paragraph tag (I used the fragment method - also with no luck).
Doesn't work in Safari / Chrome / Firefox.
Would appreciate any help that can be given!
Thanks so much!
index.html ::
third.html
Bacon ipsum dolor sit amet strip steak short ribs jowl pork loin tri-tip, meatball bacon andouille. Biltong swine spare ribs, pork chop turducken pancetta ball tip brisket turkey tenderloin. Chicken corned beef bresaola drumstick boudin pancetta. Pastrami short loin ball tip venison turducken. Flank shankle ham hock ribeye bacon sausage jowl meatloaf turkey tail fatback. Jerky meatloaf venison cow tri-tip, shoulder bacon hamburger ham pork chop.
The text was updated successfully, but these errors were encountered: