Ajax Pagination breaks custom JS. How to fix it?

Hey there fellow Bricks users! I have a question regarding the ajaxed pagination for the query loop.

Once the ajaxed page refresh happens on the query loop, the custom javascript snippets I have, basically are stripped out of the DOM, and they no longer work.

One custom script (1) adds extra functionality on a button which is inside of the query loop, and the other one (2) is an audio player JS library, with a custom js file (3) which applies functionality (events) to links inside the query loop… and it all works fine until the ajax refresh happens. From that point on, it’s fully broken.

…Same thing happens if I use WPgridbuilder instead…

I’m pretty sure there’s a solution/workaround for this. If anyone knows how to do it, please share it with me, before I lose half of my hair :laughing:

Thanks a lot in advance!!

Hi there, any luck with figuring out this?
I have a similar set up with custom js code outside a simple post query loop. The js breaks when I apply the filter however it is restored when I manually refresh the page with the filter query in the url.