Questions tagged [ejs]

"E" is for "embedded." EJS is a simple templating language that lets you generate HTML markup with plain JavaScript. No religiousness about how to organize things. No reinvention of iteration and control-flow. It's just plain JavaScript.

Embedded JavaScript (EJS) is a set of two open source libraries providing in-browser client side templates for web development and as a template system for node.js (including client-side template functionality). EJS uses <% %> or [% %] tags, executing any JavaScript within the tags. Adding an equals sign (<%= %>) causes the enclosed JavaScript to be evaluated, and the toString representation to be appended to the document.

The original client-side EJS has been subsumed into JavaScriptMVC, official support is offered at their forum (the old Google Groups group is no longer active).

Install via npm: npm install ejs.

References:

6440 questions
1
vote
0 answers

Node Js sqlResponse values are not read by JavaScript/ jQuery

Hey There hope you all are fine from CORONA. I have a little issue that i have a page on which all countries name are coming from the database and displaying on the page. What i want, i want them to be clickable as a
  • and by using the AJAX…
    Engineer S. Saad
    • 378
    • 4
    • 19
    1
    vote
    1 answer

    Video not loading in EJS, (node.js server)

    I am using node.js server to upload a video. I am successfully able to add it in /public/uploads folder of my project and save the FilePath to MongoDB. Inside my ejs, file, I am retrieving videos, by following segment of code //Videos is the array…
    1
    vote
    2 answers

    Get index value from a clicked button in forEach loop and pass the value to app.js

    I have a programme using .js and ejs that when you enter a weight it creates a row with your weight and date and posts to the website I need a way to delete the row that when that row's delete button is clicked. To delete the row I am trying to get…
    slih01
    • 21
    • 2
    1
    vote
    1 answer

    How to automate client side bundling of javascript everytime I make change in the file

    I am creating a basic node js application with express and ejs template engine. I want to use npm libraries like axios in the views that I create. Is it possible to create bundle files from those Edit 2 : What I wanted to ask here is there a way to…
    Nisha Dave
    • 669
    • 1
    • 9
    • 25
    1
    vote
    1 answer

    ejs array in an object

    Here is the code in nodejs(express): response.redirect('file',{test: [{name:'sarah',arr:[1,2,3]},{name:'beck',arr: [2,3,4]}] Now I want to access the 'arr' for every name in the array of objects.In ejs file: <% test.forEach(index,item){…
    loksan
    • 157
    • 3
    • 17
    1
    vote
    2 answers

    cannot find module file

    I am doing my Udemy course and I am stack now ;( If anyone can help me it would be great! So the Error said "Error: Cannot find module '/Users/yui/Desktop/todolist-v1/date.js' Require stack: - /Users/yui/Desktop/todolist-v1/app.js" but I am not sure…
    Yui
    • 13
    • 2
    1
    vote
    1 answer

    Resource interpreted as Stylesheet but transferred with MIME type text/x-scss

    i want to create a website with nodejs but i have a problem with show style in scss and ejs . i have a scss style in folder ../app/public/scss and i using this middlware for set static file with express : …
    kianoush dortaj
    • 411
    • 7
    • 24
    1
    vote
    1 answer

    Pass Data From Node/Express to Front-End Javascript

    I am unsure how this would work exactly, and I am unable to find my answer from searching for it. I am working with a node and express server, and have been passing data to my front end ejs without issues. Now, I am trying to implement charts.js…
    Zernst
    • 315
    • 4
    • 17
    1
    vote
    1 answer

    Not able to access JSON in EJS template inside script

    I am trying to build a webapp which renders dynamic charts based on JSON passed from node to client side. However I am not able to access json variable inside