alert
, confirm
and prompt
JS-005241});
42
43socket.on('signupsuccessful',(msg)=>{
44 alert("SignedUp");45})
46
47socket.on('signuperr',(msg)=>{
45})
46
47socket.on('signuperr',(msg)=>{
48 alert(msg);49})
50
51socket.on('msgerr',(err)=>{
49})
50
51socket.on('msgerr',(err)=>{
52 alert(err);53});
54
55socket.on('roommsg',(msg)=>{
53});
54
55socket.on('roommsg',(msg)=>{
56 alert(msg);57});
58
59socket.on('nameerr',(msg)=>{
57});
58
59socket.on('nameerr',(msg)=>{
60 alert(msg);61});
62
63socket.on('autherr',(msg)=>{
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();
}