3

Disqus doesn't appear on localhost. I tried this solution, but I believe this method has been deprecated because it no longer works. All of the answers I've seen online are that, but they're all a few years old. If anyone knows how to test it on a localhost without an active server or domain, I'd really appreciate it. Here is the code I have (what Disqus gives you on their site):

<div id="disqus_thread"></div>
<script type="text/javascript">
    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
    var disqus_shortname = ''; // required: replace example with your forum shortname

    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

EDIT: In case you're wondering, the only thing that shows up is the "Comments powered by Disqus" as a link.

Jose Magana
  • 931
  • 3
  • 10
  • 24

1 Answers1

2

This is a long shot but can you try

    dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';

instead of

    dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';

Make sure you test it when running a server rather opening a plain html file.

ma08
  • 3,654
  • 3
  • 23
  • 36
  • I think this is actually an improvement. Now it says, "We were unable to load Disqus. If you are a moderator please see our troubleshooting guide." The troubleshooting guide it links me to is here: https://help.disqus.com/customer/portal/articles/472007-i-m-receiving-the-message-%22we-were-unable-to-load-disqus-%22 – Jose Magana Jul 31 '14 at 19:09
  • Opening the html as a file. I don't have a server yet. I'm pretty sure this is the solution and you just can't have comments working unless it's a live server. – Jose Magana Jul 31 '14 at 19:15
  • Yep. Seems to be the case. – ma08 Jul 31 '14 at 19:17