O'Reilly logo

Practical Web Technologies by V. Lau, P. K. Yuen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.2. Basic boxes and controls

7.2.1. User alert and confirm boxes

Script has a set of built-in functions that can make your life a lot easier. For example, if you want to generate a user alert box, all you have to do is to call the script function alert(). In many cases, a user alert box can provide helpful information to prevent errors and to confirm actions. An alert box is just a small window with an OK button and a warning message (see Fig. 7.3). You can create an alert box easily with the script in ex07-05.txt.

Figure 7.3. Alert box

Listing . ex07–05.txt
 1: <body> 2: <script> 3: alert("This is a user alert box! ") 4: </script> 5: </body> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required