In the callback you can try unwrap().
$('#news_date-1').load('test.php .news_date-1', function () {
$(this)
.find('.news_date-1')
.contents()
.unwrap();
});
This is not the most beautiful solution, because it .load()already inserts it into the DOM, and then you again intervene in the DOM, which should be minimized.
Another way I see is using $.get()instead:
$.get('test.php', function(receivedHtml) {
var neededHtml = $(receivedHtml).find('.news_date-1').html();
$('#news_date-1').append(neededHtml);
});
source
share