Read this tutorial and learn useful information about the jQuery function that waits and then executes the function when all the ajax requests resolve.