首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Disqus this.callbacks.onNewComment不工作

Disqus this.callbacks.onNewComment不工作
EN

Stack Overflow用户
提问于 2017-07-13 23:15:49
回答 1查看 183关注 0票数 0

不知何故,我无法使Disqus this.callbacks.onNewComment工作。会出什么问题呢?我在试着提醒(‘嘿!’)一旦有新的评论发布。Source

代码语言:javascript
复制
<script>
var disqus_config = function () {
this.page.url = PAGE_URL;  
this.page.identifier = PAGE_IDENTIFIER;
    this.callbacks.onNewComment = [function(comment) {
          alert(comment.id);
          alert(comment.text);
          alert('hey!');

    }];
};

(function() {  // DON'T EDIT BELOW THIS LINE
    var d = document, s = d.createElement('script');

    s.src = 'https://example.disqus.com/embed.js';

    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
})();

EN

回答 1

Stack Overflow用户

发布于 2017-07-27 22:09:21

  1. PAGE_URLPAGE_IDENTIFIER需要特定于您的站点
  2. 此回调用于检测此浏览器窗口发布的新帖子。不是来自其他用户(甚至是您自己在其他浏览器窗口中的用户)的新帖子

第二个帖子让我大吃一惊,因为我以为这是为了表明新帖子到了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45084827

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档