alert
, confirm
and prompt
JS-0052100 },
101 function (error) {
102 console.log("FAILED...", error);
103 alert("Form Submission Failed! Try Again");104 },
105 );
106});
96 function (response) {
97 console.log("SUCCESS!", response.status, response.text);
98 document.getElementById("contact-form").reset();
99 alert("Form Submitted Successfully");100 },
101 function (error) {
102 console.log("FAILED...", error);
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();
}