Using the datafilter parameter in an .ajax query using javascript
<p>I'm performing a search using the jQuery .ajax function but I need to filter the results to get rid of some code that's generated from the search. The CMS I'm using wraps all content in a body tag, etc. I need to grab just the contents of a specific div and load it into my target div. Here's what I have so far:</p>

<pre><code>$('#submitQuery').click(function(){

$.ajax({
url: '/Default.aspx?CCID=18511&amp;FID=101997&amp;ExcludeBoolFalse=True&amp;PageID=10212140',
type: "POST",
data: "CAT_Custom_300770="+tags1,
success: function(data2) {
$('#results').append(data2);
},          
dataFilter: function(data) {
return $(data).find('.queryResults')[0];
$('#results').append(data);
}
});

&lt;div id="results"&gt;&lt;/div&gt;
</code></pre>

<p>The code on the results page that I'm trying to load into the #results div is:</p>

<pre><code>&lt;div class="queryResults"&gt;(Results go here) &lt;/div&gt;
</code></pre>

<p>The CMS adds a bunch of extra code like links to standard style sheets, body tags, etc.</p>

<p>What I'm trying to do is bring only the contents of the .queryResults div and load it into the #results div. </p>

<p>Any help is appreciated!</p>
