There are several q and a on this on SO, but I have not found any that concerns my problem. And I'm at a standstill with that. Redirect me to the link if you know the available answer to this question.
My page is blank DIV #posts_insertin which new entries are inserted through 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);
}
});
I want the new message to disappear by replacing #posts_insert. I tried several iterations on success, using hide()before fadeIn, but I just can't do the job.
Any ideas how to solve this? Thanks in advance.
source
share