我正在撰写评论后页面,我在制作评论无序列表时遇到问题listToggle
我的代码 -
$("#ccoomm").click(function() {
var pid = $(this).attr("class");
var text = $(".comment" + pid).val();
var email = $("#hidden").val();
var data = "pid=" + pid + "&text=" + text + "&email=" + email;
$("#flash").show();
$("#flash").fadeIn(500).html('<img src="wamp.gif" /> Loading...');
$.ajax({
type: "POST",
url: "comments.php",
data: data,
cache: false,
success: function(html) {
$("#"+pid).append(html);
$("#flash").fadeOut(100);
$("#text").val("");
$(".comments"+pid).slideToggle(100);
$(this).toggleClass("active");
}
});
});
答案 0 :(得分:0)
也许试试
$('.'+pid).append(html);
而不是
$("#"+pid).append(html);