如何使用jQuery重新加载或刷新特定新闻源的评论框?

我有一个正在滚动滚动加载的帖子或新闻提要数据。用户可以在该帖子或新闻源上发表评论。发表评论后,该newfeed的特定评论框应重新加载或刷新。

$(document).ready(function() {
  $(document).on('submit','[id^="comment-form-"]',function(){
  event.preventDefault();
  alert(1);
      var formId = this.id;
        $.ajax({
          type: "POST",url: link+'/new-comment',data: $(this).serializeArray(),success: function(data){
            clearError();
                if(data.success=='success'){
                  var r = data.post_unique_id;
                  //I would like to update this two div.
                  $('#post_id_count_'+r+'').load(location.href +  ' #post_id_count_'+r+'');
                  $('#post_id_comment_'+r+'').load(location.href +  ' #post_id_comment_'+r+'');
                  $('#comment-form-'+r+'').trigger('reset');
                } else {
                  $('#comment_enter_'+r+'').addClass('err-border');
                }
            },error: function(xhr,status,error) {
                errorAlert("Error!","Oops ! something went wrong");
            },});
      });
});

如何重新加载或刷新新添加的数据?

libenlai04261 回答:如何使用jQuery重新加载或刷新特定新闻源的评论框?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3167974.html

大家都在问