Lets backtrack for a moment. I have a similar situation, but I don't use that particular plugin (its an older setup, recently modified with jQ).
When you load the new div with your ajax call, add the sort to your success: function. For example, in your test case: $.ajax({ type: "GET", contentType: "html", url: url, async: true, success: function (conf) { $("#myDiv").html( conf ); $('#user_list th').hover(function () { alert("test test"); }); } }); Kris On Mar 28, 10:48 pm, echobase <[EMAIL PROTECTED]> wrote: > I think I may be getting closer and maybe getScript() is the answer. > But I'm still not getting a some things.... > Where and how would I use the getScript() function? I've looked for > relevant examples but I can't find any that remotely > fit my situation. If I have a page with this ajax function and empty > div: > > $.ajax({ > type: "GET", > contentType: "html", > url: url, > async: true, > success: function (conf) { $("#users_list_view").html( conf );}}); > > <div id="users_list_view"> > > </div> > > ..........and the url I'm loading contains this table to fill that > div: > > <table id="users_list" class="sortable> > <thead> > <tr> > <th class="sortable">Last Name</td> > <th class="sortable">First Name</td> > <th class="sortable">Sales</td> > </tr> > </thead> > <tbody> > ..... > </tbody> > </table> > > .....then where exactly do I put the jQuery code I described earlier > that handles events from this loaded table? > The jQuery code is supposed to put an alert on the page when you hover > over one of the table headers, but that's > just a test. What I really want to do is use Tablesorter to make the > columns sortable when the headers are clicked. > Thanks very much for your help. Again, I think I may be close...... > > On Mar 27, 5:38 pm, jquertil <[EMAIL PROTECTED]> wrote: > > > > > you want to ook into the getScript() function. the SCRIPT tags arent > > interpreted by jquery, so you have to load the script separately. > > > On Mar 27, 4:10 pm, echobase <[EMAIL PROTECTED]> wrote: > > > > I'm loading a div using this .ajax function: > > > > $.ajax({ > > > type: "GET", > > > contentType: "html", > > > url: url, > > > async: true, > > > success: function (conf) { $("#myDiv").html( conf );} > > > > }); > > > > <div id="myDiv"> > > > > </div> > > > > In that url that's being loaded I have this jQuery function: > > > > <script type="text/javascript"> > > > $(document).ready(function() { > > > $('#user_list th').hover( function () { > > > alert("test test"); > > > }); > > > }); > > > </script> > > > > <table id="user_list"> > > > ........ > > > ........ > > > ........ > > > </table> > > > > But this simple function doesn't work. Why not? If I type the url for > > > this page directly then the function does work. How do you get a > > > jQuery > > > function to work from a div loaded by ajax? Thanks.- Hide quoted text - > > - Show quoted text -