Shopping Cart - On Screen Messages
When a user clicks the Buy button, a message will appear indicating which item has just been purchased, and the Number of Items Count on the screen will increase by one. This is accomplished by an Ajax Callback (server-side) to update the database and get the appropriate message, and then a JavaScript (client-side) screen update to display the results. This method avoids needing to refresh the browser to display updated information. If the browser is refreshed, the current information is also displayed.