alert
, confirm
and prompt
JS-0052104 });
105 });
106 } else {
107 alert("Couldn't terminate solvers");108 }
109 setNotification({
110 message: "Solver stopped. 🛑",
125 user.removeRun(run.id);
126 setNotification({ message: "Run deleted. 👋", kind: "danger" });
127 } else {
128 alert("Couldn't delete run");129 }
130 setDeletingRun(false);
131 });
51 });
52 user.removeMzn(instance.id);
53 } else {
54 alert("Couldn't delete mzn"); 55 }
56 setDeletingMzn(false);
57 });
51 });
52 user.removeDzn(instance.id);
53 } else {
54 alert("Couldn't delete dzn"); 55 }
56 setDeletingDzn(false);
57 });
JavaScript's alert
, confirm
and prompt
functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation.
Furthermore, alert
is often used while debugging code, which should be removed before deployment to production.
alert("here!");
confirm("Are you sure?");
prompt("What is your name?", "John Doe");
customAlert("Something happened!");
customConfirm("Are you sure?");
customPrompt("Who are you?");
function foo() {
const alert = myCustomLib.customAlert;
alert();
}