1. 自己对用户评论的需求太过乐观
2. 需要多去一个管理入口,增加管理成本
相关代码
var $arth_obj = $(‘#cb_post_title_url‘);
if ( $arth_obj.length > 0){
var ds_url = $arth_obj.attr(‘href‘);
var ds_title = $arth_obj.text();
var ds_art_id = ds_url.match(/\d{2,10}/g).join(‘‘);
var ds_html = ‘<div class="ds-thread" data-thread-key="‘+ds_art_id+‘" data-title="‘+ds_title+‘" data-url="‘+ds_url+‘"></div>‘;
$(‘#blog-comments-placeholder‘).before(ds_html);
var ds = document.createElement(‘script‘);
ds.type = ‘text/javascript‘;ds.async = true;
ds.src = (document.location.protocol == ‘https:‘ ? ‘https:‘ : ‘http:‘) + ‘//static.duoshuo.com/embed.js‘;
ds.charset = ‘UTF-8‘;
(document.getElementsByTagName(‘head‘)[0]
|| document.getElementsByTagName(‘body‘)[0]).appendChild(ds);
}
});