Many Disqus Modules On A Single Page

Posted by Weston Ganger on September 05, 2015

For many SPA’s or AJAX sites loading multiple disqus modules per page can be a pain.

You can only show one disqus module at a time. So you must use a button or something that shows and hides on click.

var disqus_shortname = 'disqusShortname';
var disqus_identifier = 'disqusIdentifier';
var disqus_title = 'postTitle';
var disqus_url = '';

if(typeof(DISQUS) === 'undefined'){
  (function() {
    var dsq = document.createElement('script');
    dsq.type = 'text/javascript';
    dsq.async = true;
    dsq.src = '//' + disqus_shortname + '';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
} else {
    reload: true,
    config: function() { = disqus_url; = disqus_url; = disqus_title;

Related External Links:

Posted in Javascript and Tagged with disqus comments 

Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts