How do you run a jQuery function back-to-back, waiting for the first to complete?
===

I know I need a callback to solve this problem, but I just can't get it right.  I've tried a few different solutions, but I'll save you from having to look at my attempts.  Instead, I'll just show what I'm trying to accomplish.



    theCodeToRun('123', '1');
    //Wait for it to complete...
    theCodeToRun('123', '0');

    function theCodeToRun(myID, exitEarly){
        //Do some stuff (using myID)
        if(exitEarly == 1){
            return false; //Exit
        }
        //Do some more stuff
    }