Me again, I am almost completely new to AJAX, so this is probably something obvious, but basically, I am working on a Facebook app and am trying to utilize AJAX in order to execute complex PHP scripts. Right now, I am working a bit of code that imports tiles and then get's their color averages. It's pretty simple and mostly imagecolorat(), Facebook.photos.Get(), and imagecopyresize() as well as creating a few text documents to store info, but it runs really slowly because of all the pictures it's going through, and it usually returns an internal server error if not used by AJAX. So far, it is functioning properly, as far as I can tell it is importing all the required pictures. However for some reason if the count picture goes higher than 20, it will not print any text that is in the document . I'd really like to have it print out the NEXT button so the user doesn't press it before the pictures are finished importing. Is there anyway I can do this? I guess I'm asking for either a way to figure out why it printing text when it's finished, or a method of having a constant checker looking for whether or not pictures are uploaded that can add the buton for me. As always, any help would be much obliged