Created
June 1, 2010 07:36
-
-
Save dnch/420683 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var CallbackObject = { | |
| task_a_done = false, | |
| task_b_done = false, | |
| trigger = function(which_task) { | |
| if(which_task == "A") { this.task_a_done = true; } | |
| if(which_task == "B") { this.task_a_done = true; } | |
| if(this.task_a_done && this.task_b_done) { | |
| trigger_task_c(); | |
| } | |
| } | |
| } | |
| var ajax_task_a = Ajax.new({ onComplete: function() { CallbackObject.trigger("A"); }}; | |
| var ajax_task_b = Ajax.new({ onComplete: function() { CallbackObject.trigger("B"); }}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment