Without the need of polling, there’s better way to check if there are some changes.
With MutationObserver is what you need.
Change DISQUSEXAMPLE to your Disqus name
In this script I attach onload event on the script element then, assign the parent element I need to Observe, create an Observer and a function what to do on Mutation and use Disqus Widget to reset the count, make sure if parent element exist and attach the Observer with some configurations to observe.
Sometimes when I look at the code too long, I feel I want to refactor and make a reusable function.
Subscribe to Harianto van Insulinde
Get the latest posts delivered right to your inbox
You've successfully subscribed to Harianto van Insulinde!