Alerting the User
Script 2.5. The HTML for this example includes <script> and <noscript> tags.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
Script 2.6. Alert dialog boxes help you communicate with the user.
To alert a user:
Yes, that's all there is to it, as shown in Figure 2.3. Just put the text that you want to have appear within the alert() method in straight quotes.
Figure 2.3. This script only puts up one dialog box; the four shown are examples of how the dialog box looks in, from top to bottom, Safari for Mac OS X; Microsoft Internet Explorer 6; Microsoft Internet Explorer 7; and Firefox 1.5 on Mac OS X.