Message boxes
There are three types of message boxes that can be created with this method: alert, confirm , and response. We will give an example that uses all three in the same block of code. After clicking on the button, it will call up the unique type of requestor. It should be noted that the alert is an AJAX alert box and we will prove that by calling the standard alert box in response to the selections made after choosing the buttons in the message boxes.
First we need to create our standard HTML wrapper and some functions to interact with the boxes. Our showInputResult()
function
is the smartest of the message box handlers. It watches for both the button that was clicked and also deals with the input entered, if any. The next function is to manage the button selection only when the prompted input is not provided. We will use that function for both the alert and confirm message box types. The last thing we will do is create a common function for triggering the show feature of all three...