Expand Minimize

SPC198901: Consider to not use Alert, Confirm and Prompt messages boxes in production code

Consider to not use Alert, Confirm and Prompt messages boxes in production code, as these are considered bad usability

CheckId SPC198901
TypeName PopupMessagesArePoorUsability
Severity Warning
Type JavaScriptFile

Bad Practice

alert("here!");
confirm("Are you sure?");
prompt("What's your name?", "John Doe");

Good Practice
// use an HTML container to show your alert
alertAreaElement.innerHTML = "here!";

Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.