Home > OS >  my Ejs file don't show anything because of the <% %> tag how to fix it?
my Ejs file don't show anything because of the <% %> tag how to fix it?

Time:12-10

so I searched up how to do an login system and then I found an tutorial of Web Dev Simplified and I followed the tutorial but then he wrote in an ejs file <% something %> and I wrote it too and it doesnt work can anyone help me with this problem heres the error code

<% if (message.error) { %>
    <%= messages.error %>
<% } %>

CodePudding user response:

Did you tried with:

<%= message.error %>

CodePudding user response:

What is the error message you are getting?

Do you have two different variables defined message and messages?

If Bogdan's answer didn't work did you try with <% if (messages.error) { %> in case there is no object called message?

  • Related