This should be added to the memory to prevent memory leak and keep adding old nodes to new nodes if you use PJAX. This unloads all Events from former PJAX pages and should only be used when you have it set on 1 page.
I put this here to see if this is the right approach, and or to fire some ideas upon it.
Before making a pull request for it.
$(document).on('pjax:beforeReplace', function (contents, options) { //might prevent memory leak $(contents.target).empty(); }
This should be added to the memory to prevent memory leak and keep adding old nodes to new nodes if you use PJAX. This unloads all Events from former PJAX pages and should only be used when you have it set on 1 page.
I put this here to see if this is the right approach, and or to fire some ideas upon it. Before making a pull request for it.
PuiMan Cheui also made an similar issue for it. https://medium.com/front-end-hacking/pjax-react-2ee247af0fb5