You're not using jQuery-selector the right way. To target an element with an id, use $('#element_id')
and for an element with a class $('.element_class')
. So, your selection should be as below.
$('#newsfeedposts').append(markup);
and then
$('#newsfeedposts').listview('refresh');