Alert

Updated: 04/26/2017 by Computer Hope

Alert may refer to any of the following:

JavaScript alert box1. In JavaScript, an alert is a type of "pop-up" message to users of a script. An alert could be anything from notifying the user of an error to saying a short phrase such as "Hi". A JavaScript alert looks similar to the example shown to the right. This alert can be produced by using the JavaScript code shown below.

<script type="text/javascript">
window.alert("This is an alert!");
</script>

Since the window object is a top-level object in JavaScript (when coding for web browsers), this code can be shortened to alert() rather than window.alert(), as shown in the example below.

<script type="text/javascript">
alert("This is an alert!");
</script>

While these are often known for their ability to annoy users (for example, the sending of numerous consecutive alerts), they can also be useful for giving the user information such as instructions for fixing errors in a form field. They can also be helpful to JavaScript programmers as a means of debugging a script. By using an alert message to display values, the programmer can determine where things may be going wrong in a script through the process of elimination.

2. In general, an alert box, also called an alert dialog or alert window. It is a small window that pops up providing information to the user and typically includes an OK button, and sometimes a Cancel button.

Alert box

Error messages and general information are commonly displayed in alert boxes, as it calls attention to itself and makes the user click a button to hide the message. The Windows operating system, along with third-party applications, and web pages are sources for alert boxes.

Dialog box, Programming terms