关于这个有几个问答,但我发现没有一个可以解决我的问题。我对此感到困惑。如果您知道对此的可用答案,请将我重定向到一个链接。
我的页面有一个空白DIV #posts_insert
,其中通过 Ajax 插入了新帖子。
$.ajax({
url: 'chat/posts_submit/' + <?php echo $page_id; ?>,
type: 'POST',
data: $('#posts_form').serialize(),
dataType: 'html',
success: function(html) {
$('#posts_insert').replaceWith(html);
}
});
我希望那个新帖子淡入淡出,替换#posts_insert
. 我之前尝试过多次success
使用hide()
,fadeIn
但我无法完成这项工作。
任何想法如何解决这个问题?提前致谢。