Category "ejs"

How to read the user input on the client-side, modify it with JS on the client-side, and then POST it to the sever-side (Node.js)?

Problem: I want to read a user input on the client-side, do some processing on the variable using JavaScript, still on the client-side, then POST the modified v

Express/Ejs appending localhost to script links in my index.ejs file

Error File structure Route app.get("/api/animation/:token_id", (req, res) => { const tokenId = req.params.token_id; const data = generateWorldData(); c

Node.js EJS Include feature is not working in my case

I want to include header.ejs and footer.ejs into order.ejs. The image below my folder structure. But, I've got error. The code related to include in order.ejs

Why styles.css file doesn't apply to the page

I'm moved styles.css file to every location in my project and tried to link it in html file. I moved it even in the same folder where html files are, href auto

Rota Include EJS

rotas ´´´ <%- include() %> ´´´ como posso usando include colocar o header.ejs que se encontra dentro do parts no arqui

Rota Include EJS

rotas ´´´ <%- include() %> ´´´ como posso usando include colocar o header.ejs que se encontra dentro do parts no arqui

firebase onAuthStateChanged infinite loop node js

I'm using firebase to sign in my users on my node js app. I would like to see if the user is authentificated or not and after it redirect to the page I want (lo

Displaying function values onto an already existing EJS template

I need to display a value from a JS file (indexRoutes.js) into an input box on an EJS template (calculator.ejs), I have included the script via a footer I have

Pass object to javascript function from ejs

I'm trying to attach a click event from my ejs file but I noticed that when my data coming from my database has a "newline", I get an error that says: Unexpecte

Unexpected token '}' in D:\ .users.ejs while compiling ejs If the above error is not helpful, you may want to try EJS-Lint:https://github.com/RyanZim/

This is my controller file async function getUsers(req, res, next) { try { const users = await User.find(); res.render('users', {

Display data after POST request without reloading page

I have this node.js app where you can post comments on teachers profiles. teacher.ejs <!-- Form --> <div class=""> <form id="commentsForm"

Why doesn't load data into my collection? mongodb

This is what appears on my mongo database: This is my app.post to insert the data, when I Submit it console.log the object with the dates but with create It ju

PDF font size issue using HTML with Puppeteer

I am trying to generate a PDF in browser(chrome v8) using HTML by sending it to puppeteer. The html is getting generated using ejs since there is dynamic conte

is it possible to have a flask app and an ejs website

i am making a flask app and usually i would do the following code: from flask import ( Flask, render_template, request ) app = Flask(__name__) @

Cannot read property 'substring' of undefined in ejs

When I try to add new blog posts to my website I am continuously getting this error: TypeError: C:\Users\shruti\Desktop\ejs-challenge\views\home.ejs:15 13| 14|

Divs inside my ejs loop are not rendering

<div style="display: flex; flex-wrap: wrap; justify-content: center;"> <% guser._roles.forEach(async el => { let urole = await guild.roles.cache.g

how to define this variable "usersWithSecret is not defined" in app.js?

app.get('/secrets', function(req, res){ User.find({'secret': {$ne: null}}, function(err, foundUser){ if(err){ console.log(err); } else{ if(foundUser){

how do I use for loop inside script tag in ejs

I try to draw chart, using chart.js. To get my data, I try to use ejs tags for example, in ejs I input html like this, and it works well. <p>date

How to store and update variable in ejs, access it on different routes

I am absolute beginner concerning javascript, express, node, ejs, etc, please go easy on me. :D I am creating a website, which is a gallery of my projects. You

can I use partials in a for loop in ejs?

I'm trying to include partials in a for loop in EJS. <% let index = 1 %> <% for (let item in db) { %> <div class="box unfocused box_<