Skip to content

Tag: ejs

nodejs ejs render array object in to table

Good day I need to write a table from a database and i can’t access the values, if the array is greater than 1… If i do it like this: and on the ejs side it looks like this: if i use my hardcoded value, it works. But if i try to change the i value to 2 or more,

Post a form in Node Js

I am trying to post data from a form in node JS and then see the data in console. When i click the button I can see the data in console but the websites starts loading and it doesnt end. The loading circle doesnt stop moving. and this is in my server.js file Answer Your backend has to send a

How can I check if an EJS variable exists?

I used EJS layout in my Node.js application. Currently I faced a problem when data which is required in the EJS file is not available then it simply generate an error. What I want is to add a condition before using the EJS variable in javascript. Here is my code in which I use EJS variable inside script tag. …

node js send token through the header

i try to send token use header, (login form to index page use the header) my index file is the page redirect index page ,but the token not send the index page Answer If I understood you correctly, you expect that the authtok header will be set by the browser when a request to /index page is made. Headers are