This is an ejs file, I just write like this, and I just want to have an alert and then jump to another page. But now the question is in the alert, the mes and 'success are separated into 2 lines, and can not jump to the homepage.
<div id='Message'>
<%= message%>
</div>
<script>
showAlert = function(mes, req, res) {
alert(mes+ 'success');
return res.views('Event/home');
}
var Message = document.getElementById("Message");
var me=Message.innerHTML;
showAlert(me);
</script>