Skip to content
Advertisement

Tag: ejs

Difficulties to make another route expressJS

I am doing a site as of my studies. The technology being free, I decided to code with nodejs/Express. For my first route /home, everything went well. But I can’t create others. Yet I thought I understood the system well. It would bother me if it was due to a silly error because I have been on this problem for

animate when changing an property from JavaScript css

If I try this code I just wrote: the animation don’t work and it directly switch from the first color to the other. (Normally I retrieve the color from an API) I would want to do a transition between the 2 values Answer I found out that linear-gradient transition / animation doesn’t work. To fix this error I just used

How do I export mongodb html code to html file?

How do I display an html data piece from mongo db correctly? Data: The html was encoded What it shows: Not showing correctly Code: Answer Not really sure why you put that html on a textarea element. But if the content is comming from a database that is contain use generated content, then you probele need an html sanitizer like

Res.Render Is Stalling

Sorry if I’m sharing too much (or too little!) I’m not sure how to provide code when it’s contained in multiple files like this. In the small project I have my app.js server using express and ejs. I have a “/compose” route which creates a blog post with a “Title” and “Content”. It then pushes this into a global array

The frontend receives an array as [object Object]

I am building a website with JavaScript, express.js, ejs and Node.js and i just ran into a problem. I am sending an array to the frontend this way: And getting it on the frontend with ejs this way: If i print the array on the frontend the result will be [object Object] and I also printed out typeof(‘<%= array %>’)

Unable to push string into array

I am trying to learn EJS and make a blog but I cant seem to understand this error What I am trying to do is try to write some db response as an Object to an array then push it to the file. I am using replit DB Error that I am getting when I run the code: Answer First,

Advertisement