You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When integrating a component within a pjax enabled website, I have a strong need of cleaning up a few elements from the dom before pjax saves the current container snapshot.
At first, I though that the pjax:beforeReplace event was ideal for it - after all, "replace" can be understood like "remove the current one (take the snapshot) and inject the new one". It was too late.
Then, I thought about the pjax:start event... but for that, I went to check the source code:
When integrating a component within a pjax enabled website, I have a strong need of cleaning up a few elements from the dom before pjax saves the current container snapshot.
At first, I though that the
pjax:beforeReplace
event was ideal for it - after all, "replace" can be understood like "remove the current one (take the snapshot) and inject the new one". It was too late.Then, I thought about the
pjax:start
event... but for that, I went to check the source code:jquery-pjax/jquery.pjax.js
Lines 370 to 371 in 153262e
Conclusion:
pjax:start
andpjax:send:
Q1 (proposal): shouldn't
pjax:start
happen somewhere earlier in the code?Q2 (help!): how to safely tweak the dom before the snapshot is taken into the cache?
The text was updated successfully, but these errors were encountered: