That's weird. I used almost exactly your code with the latest SVN and I get no errors. Could it be to do with what's in the loaded file? Mine was just a simple php echo. Here's my code:
<ul id="myid"> <li>1</li> <li>2</li> </ul> <a id="clicker">clickMe</a> <script type="text/javascript"> function setupSortable() { $('#myid').sortable(); } $(function() { setupSortable(); $('#clicker').click(function() { $('#myid').append("<li id='li3'>3</li>"); $('#li3').load("newcontent.php"); setupSortable(); }); }); </script> On Apr 3, 6:16 pm, ajpiano <[EMAIL PROTECTED]> wrote: > hmmm, > my problem isn't that bound events aren't there after elements are > ajaxed in - i understand that issue. mine is like this: > > let's say i have the following > --------------------------------- > <ul id='myid'> > <li>1</li> > <li>2</li> > </ul> > <a id='clicker'>clickMe</a> > > function setupSortable() { > $('#myid').sortable(); > > }); > > $(function() { > setupSortable(); > > $('#clicker').click(function() { > $('#myid').append("<li id='li3'>3</li>"); > $('#li3').load("newcontent.php"); > setupSortable(); > > }); > }); > > ------------------------- > > my problem is that if you click #clicker, i'll get a JS error saying > that $('#myid').sortable is not a function. (i think) i totally > understand that if you ajax in an element, it won't have preexisting > events bound to it, but i haven't read a word about jQuery plugin > methods that are accessible at the top of the function scope not being > accessible later on down... > > --adam > > On Apr 2, 2:43 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > > > > > I can take credit for it. :-) > > > Very glad that you liked it. Thanks for the compliment! > > > --Karl > > _________________ > > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > > On Apr 2, 2008, at 2:20 PM, tlphipps wrote: > > > > I can't take any credit for the article. I thought it was very well > > > written though! > > > > On Apr 2, 10:18 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > >> Dude! That's exactly what I was looking for! > > > >> And I actually understand your solution too, which is a huge bonus > > >> for > > >> me. > > > >> Thanks for your time :) > > >> Steve > > > >> On Apr 2, 3:05 pm, tlphipps <[EMAIL PROTECTED]> wrote: > > > >>> I think the following like may explain the problem you're > > >>> experiencing > > >>> (if I'm understanding the problem > > >>> correctly):http://www.learningjquery.com/2008/03/working-with-events-part-1- > > >>> Hide quoted text - > > - Show quoted text -