Mithun Satheesh
Mithun Satheesh

Reputation: 27845

disqus doesnt work on https pages in chrome. Any fix?

i have an https page where i embed disqus for commenting on the posted data. Issue is when the page gets loaded in chrome, it blocks the disqus code to execute, as it is served from a http host. specifically:

script(type="text/javascript")
var disqus_shortname = 'postocks';
(function() {
    var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
    dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();

so disqus doesn't get loaded in chrome. Works fine in firefox,safari.

I tired to fix it by:

  1. making dsq.src to dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; and it dint work.
  2. i had seen the jquery docs section making use of the same earlier. Tried the page now sothat i could refer the code. Disqus seems removed.

Is there any fix by which i can geet it working on the https page? Also if i get the embed.js on my https host and serve it, will that make a difference. Please suggest.

Upvotes: 0

Views: 1262

Answers (1)

Ian Atkin
Ian Atkin

Reputation: 6356

Simply, load the Disqus content using https, as discussed here.

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

Upvotes: 3

Related Questions