$.post( url, JSON_POST,
function( data ) {
var content = $( data );
var content = $( data ).find( '#json' );
console.log(data);
console.log(content);
}
);
The result of the first console.log is
<div id="json">{"status":1,"message":"Reply submitted successfully."}</div>
<div id="test">sdfsafdsfds</div>
But for some reason the second log returns an empty array. I am trying to query the html inside the data variable but the result is always the null set.
I would really appreciate helping me with this. I went through the $.post manual but nothing is mentioned about the this problem.
P.S I am using JQUERY 1.7
findlooks for descendants of the selected elements. In your case, both elements have no descendants, not to mention any with IDjson.Instead, you are looking for a specific element of the selected ones. In this case, you should
filter[docs] the current elements: