Chaining function

Discussion in 'JavaScript' started by amorph, Jul 18, 2007.

  1. #1
    Using mootools...

    I have 3 functions that returns content from a page via ajax (function1, function2, function3). I want to chain them in order to use oncomplete. when function one is complete, start function2, etc. but I don't know exactly how to get that working... I'm a real noob at js.

    window.addEvent('domready', function(){			
    	var box = $('box'), log = $('log');
    		log.setHTML('starting...');
    		fx.start(function(){
    		
    			//function1 here
    
    		}).chain(function() {
    		
    			//function2 here
    
    		}).chain(function() {
    
    			//function3 here
    
    		})
    	});
    Code (markup):
    Can someone please help me on this one?
    Thank you.
     
    amorph, Jul 18, 2007 IP
  2. amorph

    amorph Peon

    Messages:
    200
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    sorry but that has nothing to do with what I need and neither with mootools.
     
    amorph, Jul 18, 2007 IP