How can I update the DOM after Ajax Call (jQuery)?
I'd use $.ajax()
instead of $.post()
:
$.ajax({
type:'post',
url: 'posts_in.php',
data: $("#postentry").serialize(),
success:function(data){
var id='post349';
$('<div></div>').attr('id',id).addClass('myclass').html(data).appendTo('#records_wrapper');
}
});
Quick demo of how the div will be appended and populated: http://jsfiddle.net/AlienWebguy/zuPA2/1/