is it at all possible to replace the ' in the postbody variable with ' without actually editing the postbody variable contents
var postbody = '<div class="postbody">this is tom's and bill's post</div>';
var postid = $('#post-content');
postid.append(postbody);
Create an element and set its text, then you don’t have to encode it: