On this page, I’ve developed an integration where an icon would be appended to each blog post. On page load the icons do display. However, if a user was to click on any of the category filters, the icons are no longer appended. Not sure why this wouldn’t be stored within the cache but could use some help with this.
Hello, @dennisjn.
The page itself doesn’t refresh because it’s the Ajax filter that is working. The script I’m using gets lost after the Ajax activates. So I’m not sure how to retain that.
The filter function basically reloads the page and replaces the content, it just does so with a background request which means the page loaded events don’t trigger so your code doesn’t run again.
Probably the easiest way to solve the problem would be to use a MutationObserver to monitor the page for the changes and re-run your code whenever the content is changed.