try: $('#mainContent').html(data).find('#ratesTable').tablesorter();
On Mon, Nov 9, 2009 at 20:38, sumdog <sum.not...@gmail.com> wrote: > > Hey there, > > I've read through several AJAX+tablesorter posts and am still a little > confuzzled on this. I am loading an entire table into a div like so: > > <div id="mainContent"> > <p>Loading...</p> > </div> > > <script type="text/javascript"> > $(document).ready( function() { > $.get('/ajaxRates',{}, > function(data) { > $('#mainContent').html(data); > $('#ratesTable').tablesorter(); > }); > }); > </script> > > The /ajaxRates URL returns the HTML table. I place it into the div using > the > function right after it. I then call that new table and apply tablesorter() > to it. If I do this to an inplace table, it works fine. It's just the AJAX > table I'm having trouble with. > > The new table should be fully in the DOM by the time that function returns > correct? Is there some other event I need to wait for or attach somehow in > order to get this to work correctly? > > Thanks > Sumit Khanna > http://penguindreams.org > -- > View this message in context: > http://old.nabble.com/tablesorter-%2B-AJAX-tp26278194s27240p26278194.html > Sent from the jQuery General Discussion mailing list archive at Nabble.com. > >