Oh that was easy, don’t use <%=
, use <%-
instead. For example:
<%- JSON.stringify(user) %>
The first one will render in HTML, the second one will render variables (as they are, eval)
More Related Contents:
- Pass variables to JavaScript in ExpressJS
- How to convert CSV to JSON in Node.js
- Accessing EJS variable in Javascript logic
- Unable to send numbers using res.send() using express with node
- What is the “right” JSON date format?
- Download JSON object as a file from browser
- How to perform an HTTP file upload using express on Cloud Functions for Firebase (multer, busboy)
- jQuery returning “parsererror” for ajax request
- Concatenate two JSON objects
- Get data from PHP array via AJAX and jQuery
- Remove a JSON attribute [duplicate]
- JSON security best practices?
- How to exclude some fields from the document
- How can I get a list of the differences between two JavaScript object graphs?
- How to deterministically verify that a JSON object hasn’t been modified?
- Writing a json object to a text file in javascript
- Returning JSON array from a Django view to a template
- Multiple arguments vs. options object
- How to get data passed from a form in Express (Node.js)
- Async Await map not awaiting async function to complete inside map function before mapping next item
- How to send data from HTML form to Google Spreadsheet using JavaScript?
- How to parse JSON easily?
- node.js, express, how to get data from body form-data in post request
- Safely parsing a JSON string with unquoted keys
- jQuery uses (new Function(“return ” + data))(); instead of eval(data); to parse JSON, why?
- Why JSON allows only string to be a key?
- How to add local json file in jsfiddle?
- Sending whole folder content to client with express
- Grouping JSON by values
- Iterate through nested json object array