"After our UI developer left," Danny writes, "I was tasked with figuring out why one of our admin pages would get stuck in the middle of the loading screen."

"I know creating named functions for every callback can be a pain, but this a little ridiculous...

eventManager.addDelegate(LOAD_COMPLETE,
  new FunctionDelegate(
    function() {
      eventManager.addDelegate(LOAD_COMPLETE,
        new FunctionDelegate(
          function() {
            eventManager.addDelegate(LOAD_COMPLETE,
              new FunctionDelegate(
                function() {
                  eventManager.addDelegate(LOAD_COMPLETE,
                    new FunctionDelegate(
                      function() {
                        eventManager.addDelegate(LOAD_COMPLETE,
                          new FunctionDelegate(
                            function() {                                
                              eventManager.addDelegate(LOAD_COMPLETE,
                                new FunctionDelegate(
                                  function() {                                
                                    eventManager.addDelegate(LOOKUP_COMPLETE,
                                      new FunctionDelegate(
                                        function() {
                                          PopupDisablePanel.hidePopup();
                                          renderLanguageFields();
                                          refreshDirectoryTables(); 
                                          Field.activate("macAddress_0");
                                        }
                                      )
                                    );
                                    PopupDisablePanel.setPopupText("Loading Language Info...");
                                    loadLanguageInfo();
                                  }
                                )
                              );
                              PopupDisablePanel.setPopupText("Loading Directory Entries...");
                              loadDirectoryData();
                            }
                          )
                        );
                        loadLineAccountData();
                      }
                    )
                  );
                  if (macAddress.length > 0) {
                    PopupDisablePanel.setPopupText(Loading Config Data...");
                    loadConfigData();
                  }
                  else {
                    checkCreateConfigValid();
                    PopupDisablePanel.setPopupText("Loading User Data...");
                    loadUserData();
                  }         
                }
              )
            );                
            loadStatusGroupData();
          }
        )
      );
      loadExistingUserMacData();
    }
  )
);
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!