I am using the jquery .get to load the contents of a page. The page loads okay and the ouput is stored in a variable data. I only want to grab a specific div with the id of 'result1' out of that data variable and place it on the page. I am having trouble parsing this specific element from the variable data, it seems that all elements are being placed on the page. I think this is an easy fix but its driving me crazy.
Here is the base code without any parsing attempts:
$.get("test.php?id=" + $(this).attr('id') + "&auth=1" ,function(data){
$("#details1").html(data);
});
Here is the results of data:
<div id='result1'>
<table>
<tr>
<td>testa</td>
<td>testb</td>
</tr>
</table>
</div>
<div id='result2'>
<table>
<tr>
<td>testc</td>
<td>testd</td>
</tr>
</table>
</div>
.loadand pass a selector. api.jquery.com/load/#loading-page-fragments.load()specifically allows you to select parts of the returned HTML.