alert
, confirm
and prompt
JS-005233 }
34
35 public async initiateLogin(relationId: string) {
36 const confirmation = confirm("Please provide a biometric");37 if (!confirmation) return;
38
39 const request: UserGuestRelationRequest = {
197 }
198
199 private handleInitializeGrantConfirmation(): void {
200 if (confirm("Provide your biometric to continue")) {201 this.socket?.send(`${MessageCode.FinalizeGrantConfirm}`);
202 } else {
203 this.socket?.send(`${MessageCode.CancelGrantConfirm}`);
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();
}