3.21. What do we do with the server's response?You've completed orderCoffee(), and now coffeemaker.php is done. When you send a request to brew coffee to one of the coffee makers, coffeemaker.php runs and then returns the coffee maker that completed the order, as well as the name of the person who placed the order. Jim enters his coffee order, and clicks "Order Coffee". orderCoffee() coffee.js Make Jim a large mocha using the first coffee maker coffeemaker.php 1Jim The server returns the coffee maker that finished brewing, and then the name of the person who placed the order. orderCoffee() serveDrink() When the browser gets a response from the server, it will run the callback you indicated: serveDrink(). coffee.js serveDrink() needs to let the person who placed the order know their coffee is ready, and set the status of the right coffee maker back to "Idle". |