Attaching pjax to links created at runtime? #88

Closed
opened 2017-03-31 08:43:27 -05:00 by carlows · 2 comments
carlows commented 2017-03-31 08:43:27 -05:00 (Migrated from github.com)

It seems that if I try to create a new link on the page, PJax won't work over those links and a full page reload happens instead.

Is there a way to bind PJax to links created at runtime?

It seems that if I try to create a new link on the page, PJax won't work over those links and a full page reload happens instead. Is there a way to bind PJax to links created at runtime?
carlows commented 2017-03-31 10:37:29 -05:00 (Migrated from github.com)

As a workaround for this, I'm manually binding the pjax attachLink function to any links created at runtime:

$('.slick-cloned .episode-preview-link').each(function () {
  pjaxInstance.attachLink(this);
});
As a workaround for this, I'm manually binding the pjax `attachLink` function to any links created at runtime: ``` $('.slick-cloned .episode-preview-link').each(function () { pjaxInstance.attachLink(this); }); ```
MoOx commented 2017-04-03 23:28:28 -05:00 (Migrated from github.com)

pjaxInstance.refresh() should do it

`pjaxInstance.refresh()` should do it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#88