Thank you Ryan, Thus my initial question becomes : does jquery stores somewhere all dom elements in the process of being updated by an ajax call ?
like $.ajax.processingElements = ['container1','container2']; if not, i guess that i could turn this into a plugin that adds on ajaxStart() an element to a global array and removes on ajaxComplete or ajaxError. °-¨ On Fri, Mar 6, 2009 at 5:35 PM, ryan.j <ryan.joyce...@googlemail.com> wrote: > > yeah, thats basically what i was thinking. > > personally i'd try to track the container and use a generic piece of > code for the the loading image. that way you could just use $ > (container).children(".loading") to traverse the DOM. > > or if for any reason you want to make them unique perhaps even build > an id for each loading image based on the container's id. (eg. cont1 > > cont1_Img or something) > > On Mar 6, 4:12 pm, Alexandre Plennevaux <aplennev...@gmail.com> wrote: >> no, nothing depend on it. I see now that there is a potential problem >> with the way i set up my throbber logic: there is only one available >> "loading" div for several zones. So if one zone is loading and another >> call is triggered, the "loading" panel will move to the second zone >> before zone1 is actually done loading. >> So i should create the divs each time or create directly as many divs >> as there are updatable zones, thus using a class instead of an id. >> >> On Fri, Mar 6, 2009 at 5:02 PM, Rick Faircloth <r...@whitestonemedia.com> >> wrote: >> >> > Is anything in your code dependent on your "loading" graphic id, >> > or would a class identifier be sufficient? >> >> > -----Original Message----- >> > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On >> > Behalf Of Alexandre Plennevaux >> > Sent: Friday, March 06, 2009 10:31 AM >> > To: jquery-en@googlegroups.com >> > Subject: [jQuery] Re: ajaxStart() question >> >> > hi there, >> >> > well, i trigger the ajax request much like this: no matter what they role >> > is, all my interface buttons finish by an action called >> > UI.refresh({section:'projects', sortby:'time', item:'love-me'}); >> >> > this function compares the sent properties to the current UI stored >> > properties, and if there is a change, trigger specific actions. That >> > UI.refresh() function is therefore structured like this: >> >> > ui.refresh:function(Obj){ >> >> > // 1. compare the 2 objects: current UI and Obj. If changes, update UI >> >> > if(Obj.section && Obj.section!== UI.section){ queueArray.push('section'); >> > UI.section= Obj.section; } // same for all properties >> >> > 2. loop through the queueArray and make necessary UI changes >> >> > for (i = 0; i < queueArray.length; i++) >> > { >> > switch (queueArray[i]) >> > { >> > case 'section': >> >> > // Animating the strata >> > var $thisLI = $('#' + UI.section); >> > $thisLI.strataToCenter(); >> > $('#leftcol').load(UI.CURRENT_URL); >> >> > break; >> > case 'item': >> > //do this and that... >> > $('#projectNav').load('thatpage'); >> > break; >> > } >> > } >> >> > } >> >> > it may seems like overwork to you guys, but my app is quite big and this >> > structure helps me keep the code well structured. >> >> > Thanks for taking the time to help me... >> >> > On Fri, Mar 6, 2009 at 4:16 PM, ryan.j <ryan.joyce...@googlemail.com> >> > wrote: >> >> >> that crossed my mind, but from the comments above i think he he wants >> >> multiple content boxes being populated from a number of different >> >> triggers, although he's using an id (of which he can only have one >> >> instance of anyway) as the identifier for the loading icon. >> >> >> i'm not sure this is the best way of doing it, cos unless i'm >> >> misunderstanding quite what he wants to do he'll only be able to >> >> process one ajax request at a time doing it like this. >> >> >> Alexandre, how are you triggering the ajax request?