function getJobs2(pars) {
$.ajax({
//alert(pars);
url: 'lib/ajax/getJobs2.php',
type: "POST",
data: pars,
success: function (data) {
/* THIS line returns allways null*/
console.log($(data).find('#home_right').html());
/* I can see #home_right in the output!! */
console.log(data);
$('#home_right').html($(data).find('#home_right').html());
}
});
}
The problem is that:
$(data).find('#myDiv').html() is not returning the HTML I need… but null. And i can ee the desired div in the whole data output..
Am i selecting it wrong?
I assume
#home_rightis a top level element in the response. Use.filter[docs] then:.findonly searchers for descendants of the selected elements, not for selected elements themselves.If you’d post the response, it would be easier to provide a helpful answer.