我们需要从多说获取两类数据,一类是评论和评论框需要被用来显示在单文章页面上,一类是评论数显示在首页文章列表内。
多说提供的通用代码如下:
<!-- Duoshuo Comment BEGIN -->
<div class="ds-thread"></div>
<script type="text/javascript">
var duoshuoQuery = {short_name:"你的多说二级域名"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = 'http://static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- Duoshuo Comment END -->
详细区分一下,<div class="ds-thread"></div>才是评论和评论框,下面大段的javascript代码是获取评论用的。