How to apply JS on data from Jquery's load method?
<p>Here's a snippet of the JS:</p>

<pre><code>...
$(this).load('html_fragment.html', function(data) {
    console.log(data);
    $(data).find('.accordion').accordion();
});
...
</code></pre>

<p>here's the content of the document I'm loading (html_fragment.html):</p>

<pre><code>&lt;form&gt;
    &lt;div class="accordion"&gt;
        &lt;h3&gt;&lt;a href="#"&gt;Section 1&lt;/a&gt;&lt;/h3&gt;
        &lt;div&gt;
            &lt;p&gt;
                Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
                ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
                amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
                odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
            &lt;/p&gt;
        &lt;/div&gt;
        &lt;h3&gt;&lt;a href="#"&gt;Section 2&lt;/a&gt;&lt;/h3&gt;
        &lt;div&gt;
            &lt;p&gt;
                Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
                purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor
                velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In
                suscipit faucibus urna.
            &lt;/p&gt;
        &lt;/div&gt;
        &lt;h3&gt;&lt;a href="#"&gt;Section 3&lt;/a&gt;&lt;/h3&gt;
        &lt;div&gt;
            &lt;p&gt;
                Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
                Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero
                ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis
                lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.
            &lt;/p&gt;
            &lt;ul&gt;
                &lt;li&gt;List item one&lt;/li&gt;
                &lt;li&gt;List item two&lt;/li&gt;
                &lt;li&gt;List item three&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;
        &lt;h3&gt;&lt;a href="#"&gt;Section 4&lt;/a&gt;&lt;/h3&gt;
        &lt;div&gt;
            &lt;p&gt;
                Cras dictum. Pellentesque habitant morbi tristique senectus et netus
                et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in
                faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia
                mauris vel est.
            &lt;/p&gt;
            &lt;p&gt;
                Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus.
                Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
                inceptos himenaeos.
            &lt;/p&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;&lt;!-- end accordion --&gt;


    &lt;div id="horizontal"&gt;
        &lt;p&gt;horizontal test data&lt;/p&gt;
    &lt;/div&gt;&lt;!-- end horizontal --&gt;
&lt;/form&gt;
</code></pre>

<p>Problem?: the Jquery UI accordion function does not seem to work on the wrapped object after it's been loaded.  Is there a way perform JS on the returned html fragment during the callback?</p>
