I'm working on a script that needs to call a PHP script through javascript and then use the results from that script to call another. I know how to run each script independentally, but I don't know how to call the first script and wait until it completes to call the second. And the second has to wait on the first because the first returns a database id that's needed for the second.
Any tips on where to start looking?