I am new in node js trying to send Alert messages on screen iF user added the wrong credentials .Problem is , It through an error that Alert isn't defined . if i send same message through res.send then it work without any error but I want to show alert can someone guide me Note : this code is written at server side file for node js this code through an error say alerts is not defined
Router.post('/login',(req,res)=>
{
const{
email,
password
}=req.body;
homeschema.findOne({email:email},(err,result)=>{
if(email==result.email && password === result.password)
{
res.render('activate');
}
else
{
alert("incorrect email/password")
}
})
})
this code is working fine and send a response message perfectly
Router.post('/login',(req,res)=>
{
const{
email,
password
}=req.body;
homeschema.findOne({email:email},(err,result)=>{
if(email==result.email && password === result.password)
{
res.render('activate');
}
else
{
res.send("EMAIL/PASSWORD incorrect");
}
})
})
window.alert()
message on the frontend? - cheesemas46