If you use the 'data' object, you can keep this stuff attached to the
relevant objects and out of the global namespace.

On May 20, 9:07 am, FreeKill <[EMAIL PROTECTED]> wrote:
> That would chain them all together though right, rather than fire them
> all off at the same time?
>
> I was thinking of doing something maybe like this...
>
> var processesCompleted = 0;
> var processesTotal = 4;
>
> $("#div1").load( "scripts/generateA.php", {VAR: var}, function( ) {
>      processesCompleted++;
>      performFinal( processesCompleted, processesTotal );
>
> });
>
> $("#div2").load( "scripts/generateB.php", {VAR: var}, function( ) {
>      processesCompleted++;
>      performFinal( processesCompleted, processesTotal );
>
> });
>
> etc etc
>
> function performFinal( completed, total ) {
>      if( completed == total ) {
>          // Do Final Work
>      }
>
> }
>
> I know it's kind of nasty, but I think it might work. It would be nice
> if there was some kind of queue structure that could be passed 4 calls
> and have a callback that waits for all 4 to finish...
>
> On May 19, 4:52 pm, "Alexandre Plennevaux" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > here is how i would try it, simply using the load() function built-in
> > callback parameter
>
> > $("#div1").load( "scripts/generateA.php", {VAR: var} ,function(){
> > $("#div2").load( "scripts/generateB.php", {VAR: var},
> > function(){
> > $("#div3").load( "scripts/generateC.php", {VAR: var}, function(){
> > $("#div4").load( "scripts/generateD.php", {VAR: var} );
>
> > } );
> > }
> >  );
> > });
> > On Mon, May 19, 2008 at 10:39 PM, FreeKill <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I'm thinking there is something I'm just overlooking, but I hope
> > > someone can help...
>
> > > I have a set of load calls that are each made at document load:
>
> > > $("#div1").load( "scripts/generateA.php", {VAR: var} );
> > > $("#div2").load( "scripts/generateB.php", {VAR: var} );
> > > $("#div3").load( "scripts/generateC.php", {VAR: var} );
> > > $("#div4").load( "scripts/generateD.php", {VAR: var} );
>
> > > What I want to do is make a 5th load call, but only once the previous
> > > 4 are completed. Is there a way to wrap a block of calls in a way that
> > > a Callback function is called when they call complete?
>
> > > I can think of some other, less optimal ways of getting this
> > > accomplished, but I'm hoping someone might know how to do it the way
> > > I've got it going now.
>
> > > Any suggestions? Your help is appreciated...
>
> > --
> > Alexandre Plennevaux
> > LAb[au]
>
> >http://www.lab-au.com- Hide quoted text -
>
> - Show quoted text -

Reply via email to