ejs Questions

7

Solved

im working on node.js(express) with ejs and im not able to include a .css file to it.i tried the same thing seperately as a html-css duo and it worked fine...how can i include the same in my .ejs f...
Tunesmith asked 5/9, 2013 at 6:35

10

Let's say I saved a snipplet of a footer. How do I "include" that in my current template?
Phallicism asked 28/4, 2011 at 4:53

3

Solved

I have a script tag in my show.ejs file, and I have the following line: <script> const post = <%- JSON.stringify(post) %> </script> I'm getting the error of 'Error Expected' on ...
Nadia asked 27/3, 2021 at 3:13

9

I show date by this in ejs <%= new Date();%> it give me result Tue Feb 02 2016 16:02:24 GMT+0530 (IST) But I need to show as 19th January, 2016 How can I do this in ejs?
ejs
Pettifog asked 2/2, 2016 at 10:41

7

Solved

I'd like to render a 'current' class on each of my navigation links depending on which page I'm on in my layout.ejs template. Currently, my express controller index looks like this: // About expo...
Comprehensible asked 21/11, 2014 at 1:0

28

My issue is that I've tried to create a new React project and after a lot of issues with vulnerabilities, I managed to solve some of them, one of the main instructions was adding this line: "o...
Stenger asked 8/6, 2023 at 19:56

3

So I wanted to precompile ejs templates into a .js file var compiled = ejs.compile(source); fs.writeFileSync(target, 'myTemplateFunction = ' + compiled); but that serilalizes into function (l...
ejs
Monostome asked 21/7, 2012 at 2:52

9

I am trying to follow this tutorial and write some code in EJS in VS Code. I ran npm i express ejs as per the video's instructions to install both Express and EJS, and no errors popped up in the co...
Interested asked 8/12, 2019 at 17:48

2

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 content for some of the sections of the PDF...
Highball asked 10/2, 2021 at 13:35

4

I'm using Node.js with Express web framework (and EJS template engine). When I have to print a variable I do something like: <% if (value) { %> <%= value %> <% } %> Can I do ...
Lungi asked 22/12, 2011 at 22:22

6

Solved

I cannot find a way to include external .js file to Node ejs template. I want to put logic and data into object in external .js file, include that file to index.ejs template and pull data from it. ...
Faber asked 29/10, 2017 at 14:47

11

To use MomentJS in views/custom.ejs, what is the correct way (if any)? Server side routes/index etc we can easily use require('moment'); etc and it works fine. Server Side (EJS views) views/custo...
Tchad asked 9/10, 2012 at 7:24

12

Solved

I have the following code in my express app (app.js file): const express = require("express"); const app = express(); app.set('view engine', 'ejs'); app.get('/', function(req, res) { res.render...
Intensive asked 8/7, 2018 at 10:55

4

Solved

I'm making a configuration for my web application, try to rendering it to web page. Below is part of my code. I want to the option selected to the config[0].volume has. So, if config[0].volume is '...
Apocarpous asked 19/1, 2016 at 13:33

21

Solved

On the EJS github page, there is one and only one simple example: https://github.com/visionmedia/ejs Example <% if (user) { %> <h2><%= user.name %></h2> <% } %> ...
Estis asked 21/3, 2011 at 0:9

6

I have this code in an EJS file: <table> <% for(var i=0; i < data.length; i++) { %> <tr> <td><%= data[i].id %></td> <td><%= data[i].name %><...
Diatropism asked 21/3, 2015 at 8:12

5

Solved

I am new in node JS, and try to implement CRUD using Node JS, Express JS , MS SQL, EJS. And I am already finished with CRUD. But I am looking for some more reliable way to pass data or objec...
Vimineous asked 5/5, 2015 at 7:5

13

Solved

I'm trying to follow the instructions to https://mcmap.net/q/246630/-adding-css-file-to-ejs, but I still can't get my styles.css to load. From app.js app.use(express.static(path.join(__dirname, ...
Achelous asked 5/7, 2014 at 2:1

4

Solved

I am using jQuery mobile and I am trying to center some image icons within a list. The problem I am having is that the images are not vertically centered within a list item. Can someone kindly poin...
Alberik asked 29/2, 2012 at 13:30

8

Solved

I am working on a template where I am trying to render template using express and ejs. As to the standard structure of node app, I have app.js file which which contains functions like following: a...
Crazed asked 29/5, 2015 at 17:7

6

base.ejs: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>My Diary</title> <link rel="stylesheet" href...
Southeaster asked 22/1, 2017 at 20:37

10

Solved

I'm running a simple server var express = require('express') var app = express() app.set('view engine', 'ejs'); app.use(express.static('public')) // home page request handler app.get('/', func...
Stringed asked 19/9, 2017 at 21:14

6

enter image description hereI am trying to run an ejs file and gets error Error: Could not find the include file "partials/head". i have checked most of the articles from stackoverflow and github...
Sulphurate asked 17/2, 2019 at 8:14

6

Solved

As I wrote in the title, I'd like to get a value from a variable written into a ejs page/file, from a javascript file within the same page EJS: <% var test = 101; %> JS: <script> ...
Smaragdite asked 19/2, 2015 at 10:13

3

Solved

I have a front-end that is built using React states that is meant to adapt based on user action. However, my front-end React is also meant to show and allow manipulation of my server-side data. Cur...
Niggard asked 5/9, 2016 at 19:22

© 2022 - 2024 — McMap. All rights reserved.