Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8957481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:59:59+00:00 2026-06-15T14:59:59+00:00

Has anyone gotten Disqus to work properly with something like PJAX or even regular

  • 0

Has anyone gotten Disqus to work properly with something like PJAX or even regular #! AJAX.

Lets look at some examples of people who are doing this:

  1. http://donejs.com/
  2. http://www.playmodules.net/demo/1

The first one is using Hash bang style and the second one PJAX. Now click around those sites and you will notice in Disqus that your gravatar icon disappears and if you open the javascript console you will typically get errors and log messages because the DISQUS object has trouble unbinding.

I have tried my own random hacks (which is difficult because I can’t find a DISQUS js that is not obfuscated through minification):

(function() {
    if ( document.getElementById('my_disqus_script') && document.getElementById('disqus_thread') ) {
        //var ds = document.getElementById('my_disqus_script');
        //(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).removeChild(ds);
        alert(window.location.href);
        DISQUS.reset({
            reload: true,
            config: function() {
                this.page.identifier = 'disqus_thread';
                this.page.url = window.location.href + '#!disqus_thread';
            }
        });
    }
    else if (document.getElementById('disqus_thread')){
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.id = 'my_disqus_script';
        dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    }
    else {
        var ds = document.getElementById('my_disqus_script');
        if (ds)
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).removeChild(ds);
        if (window['DISQUS']) {
            alert('cleanup');
            DISQUS.reset();
            DISQUS.cleanup();
            DISQUS = null;
        }
    }
})();

Basically I tried a bunch of cleanup techniques so that when my PJAX loads the new page it should cleanup but I always get some events that are bound to null throwing an exception.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:00:00+00:00Added an answer on June 15, 2026 at 3:00 pm

    @JanHančič was correct in that an iframe is the best route (so if he answers I’ll mark him correct). The height and seamless of the iframe can be handled with: https://github.com/house9/jquery-iframe-auto-height

    What I did is make a controller (or whatever your framework calls it) that handles any url like: http://my.com/page/disqus which will load comments for http://my.com/page.

    The controller just loads the DISQUS widget (wrapped in a html/body). Then in http://my.com/page template you include the iframe to http://my.com/page/disqus.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone gotten the glassfish v3 adapter to work with Eclipse without restarting every
Has anyone gotten the Globalize plugin to work Rails 2.3.2 or later? If so,
Has anyone gotten Fluent NHibernate to work with Castle ActiveRecord? I am particularly interested
Has anyone successfully gotten swfaddress to work with IE8 and above? It seems that
Has anyone ever gotten the Sphinx ranking options to work? I've read the manual
Has anyone gotten multi-touch zoom to work on a textView? I have searched SO
Has anyone gotten Multicast to work on Android 2.2, specifically JmDNS for Bonjour service
Has anyone gotten the IFilter sample from Microsoft to work on 64bit Windows 7?
Has anyone gotten the Open Source QR Code Library to work with ColdFusion? I
Has anyone gotten dotNetOpenAuth to work with F# and ASP.NET MVC yet? I've corrected

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.