Integrating Comment section to Website


(UserXtreamz) #1

Hi ,

I am using following code for integrating discourse comments to my website:

<div id="discourse-comments"></div>

<script type="text/javascript">
  var discourseUrl = "",
      discourseEmbedUrl = '';

  (function() {
    var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
      d.src = discourseUrl + 'javascripts/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);

But its showing “Loading Discussion…” its not loading any comments from discourse. Any one please give the solution for this?

(Abdul Munim Zahid) #2

Did you change the Discourse URL and Discourse embed URL in the code when posting to your website?

(UserXtreamz) #3

Yes i changed. But its still showing the loading discussions message

(Marcin Rataj) #4

Do you see any error in JavaScript console?
Perhaps you are running on different domains and you dont have CORS headers set up?