Scripting technologies which use scripting alerts for non-emergency communication.
This technique relates to:
The objective of this technique is to display a dialog containing a message (alert) to the user. When the alert is displayed, it receives focus and the user must activate the OK button on the dialog to dismiss it. Since these alerts cause focus to change they may distract the user, especially when used for non-emergency information. Alerts for non-emergency purposes such as displaying a quote of the day, helpful usage tip, or count down to a particular event, are not presented unless the user enables them through an option provided in the Web page.
The script below will display a quote in an alert box every ten seconds, if the user selects the "Turn Alerts On" button. The user can turn the quotes off again by choosing "Turn Alerts Off".
Within the body of the page, include a way to turn the alerts on and off. Below is one example:
<body> <p>Press the button below to enable the display of famous quotes using an alert box<br /> <button id="enableBtn" type="button" onclick="modifyAlerts(true);"> Turn Alerts On</button><br /> <button id="disableBtn" type="button" onclick="modifyAlerts(false);"> Turn Alerts Off</button></p>
Working example of this code: Demonstration of Alerts.
- Load the Web page and verify that no non-emergency alerts are displayed.
- Verify there is a mechanism to activate the non-emergency alerts.
- Activate the non-emergency alerts and verify that the alerts are displayed.