2
votes

I am trying to get the comment count from disqus. Now To count comments, I just use javascript provided by Disqus like this

 function () {
            var s = document.createElement('script');
            s.async = true;
            s.type = 'text/javascript';
            s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
            (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
        }()

Btw, I look into them which are not updated right now. So I want to solve this problem how to update the number of comments in real-time. Do you have any idea for this? Please let me know.

Thanks

1
"Java is to Javascript what Car is to Carpet". I like that quote. And it's accurate :p - keyser
Do you happen to remember where you heard that from? - supersam654
@supersam654 Yes, it was a comment here. Remember to use the @ so I get a notification - keyser
@Keyser Thanks and thanks :) - supersam654

1 Answers

0
votes

To load disqus comments count dynamically add the following code to your template:

DISQUSWIDGETS.getCount({reset: true});

One common use case of this function is to update elements on the page that were not available via the initial load of count.js.