I am using below code to get a page:
$.get('http://example.com/page1.html', function (data) {
});
Now lets imagine there is a #content div inside that page1.html and I need to read it's inner html as I already have #content div on page where Ajax call is occurring.
What is the right way to do this? I've tried with:
data = $(data).find('#content').html();
$("#content").empty().append(data);
But it seems that html() function is not the right one as it returns null, while contents() is returning data but I am not skillful enough to get only what I need from it.
Any help appreciated, thanks!!