thybag / PJAX-Standalone

A standalone implementation of Pushstate AJAX, for non-jquery webpages.
203 stars 42 forks source link

On History.back all links in the page are registered for pjax. #8

Closed arunmur closed 10 years ago

arunmur commented 10 years ago

When I use useClass in my pjax.connect, this is ignored when you click the back button. Instead it registers all the links on the page for pjax.

Scenario: Page 1: Has a link to Page2. The link has a class pjaxload. I call pjax.connect({ 'useClass': 'pjaxload'}) to register that link. Page1 also has links to Page3 and Page4 which are not to be loaded via pjax.

User: Is on Page1. Clicks on link to Page2, then clicks on back button or we do a history.back() on the page. Now all links on Page1 including links to Page3 and Page4 are loaded through pjax, whereas only Page2 link should be loaded through pjax.

PS: I have a patch for it, which has been working on my webpage for a while.

thybag commented 10 years ago

Hello,

I've just pushed a fix in to my develop branch which should hopefully resolve this issue. https://github.com/thybag/PJAX-Standalone/tree/develop

If anyone have a few momentsb to give it a try, it would be great to get some feedback before i move it over to master.

Thanks, Carl

thybag commented 10 years ago

Closing as believed to be resolved. Can reopen if issue persists.