0

I have invoked series of triggers in loop. Each trigger that is fired in the loop actually does a ajax call to server and gets the data also does some other work.... Now I want to wait till all these triggers are completed and only after all these triggers are completed I need to display some popup.

My question is how will I know all the triggers are completed?.

Prakash
  • 11
  • 4
  • set a variable to 0 when the trigger loops start and set after the last trigger the variable back to 1. Than `if(var == 1){ //show popup }` – Vinc199789 Apr 21 '15 at 15:50
  • @Vinc199789 Ajax calls are async. In it's default behavior there is now way to know which trigger will be the last. – Wahtever Apr 21 '15 at 16:04

0 Answers0