2

Disqus は、リクエストに応じて定義済みのキャプションを自動的に配置します。例: 新しいコメントを追加

ready() で jquery を使用してその値を変更しようとしました:

$('#dsq-new-post h3').text('Paticipa con tu cuenta favorita');

成功しません:( ... disqusスクリプトがデータの解析を終了したことをどのように知ることができるので、h3のキャプション値を変更できますか?

ところで、これは Disqus の呼び出しです。

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

2 に答える 2

3

これが答えandufoです。できます:

$(document).ready(function() {
  window.disqus_no_style = true;

  $.getScript('http://sitename.disqus.com/embed.js', function() {
    var loader = setInterval(function() {
      if($('#disqus_thread').html().length) {
        clearInterval(loader);
        disqusReady();
      }
    }, 1000);
  });

  function disqusReady() {
    //whatever you can imagine
  }
});

$ .getscript行と終了});をコメントアウトできます。また、window.disqus_no_style = true; ライン。

私も同様の問題を抱えており、この質問を投稿しました。モハメッドは私に答えようとしましたが、彼の答えはうまくいきませんでしたが、彼はgithubに彼のコードへのリンクを投稿し、そこで正しい答えを見つけました。

Chrome拡張機能iframedomリファレンスdisqus

https://gist.github.com/471999

于 2011-06-21T05:58:29.387 に答える