사용자가 새 댓글을 추가하거나 댓글을 삭제할 때마다 댓글 섹션을로드하는 스크립트를 만들었습니다.JQuery는 클릭 할 때마다 내 의견을 복제합니다.
삭제는 완벽하게 작동하지만 내가 코멘트를 추가 할 때 스크립트 1 코멘트 다음, 요법에 5, 다음 10 I 제출을 클릭 처음으로, 2 개의 댓글 다음 번에, ... 추가
나는 왜 이런 의견을 복제하는지 알 수 없다.
function refreshComments(r_id) {
var ar = $("#arr" + r_id).attr("class");
$("#cali" + r_id).load("../functions/inC.php",{"id" : r_id,"ar" : ar},function() {
var link = $("#dani #delete" + r_id);
$(link).click(function() {
c_id = $(this).attr("class");
$(".loading" + r_id).load("../functions/delete.php",{"id" : c_id});
refreshComments(r_id);
return false;
});
$("#internal" + r_id).button();
$("#internal" + r_id).click(function() {
$(".loading" + r_id).html('<img src="../img/ajax-loader.gif" style="width:100px; margin-top: 10px;" />');
var comment = "";
var comment = $("#comment" + r_id).val();
var status = "public";
alert(comment);
$(".loading" + r_id).load("../functions/addMessage.php",{"id" : r_id,"comment" : comment, "status" : status});
refreshComments(r_id);
return false;
});
return false;
});
}
가 이상적으로 난 그냥 목록의 상단에 실제 주석을 추가하고 싶습니다하지만 난 그것을 할 방법을 아주 확실하지 않다 :
여기 내 코드입니다.
도움 주셔서 감사합니다.