Rajesh V
Rajesh V

Reputation: 11

EJS template engine

I'm doing a node.js project and I've an ejs template file which further uses templates for header and footer.

template.ejs looks like this:

<%- include(header) %>
main html body
<%- include(footer) %>

<script type='text/javascript'>
...
...
...
</script>

when I run the server, the script embedded between the script tags becomes clearly visible. How do I hide this part from the page rendered by the node server.

Upvotes: 0

Views: 98

Answers (1)

RyloRiz
RyloRiz

Reputation: 87

AFAIK, you cannot do this in EJS (I may be wrong), so you should include the script as an asset and load it from the HTML.

<script src="path/to/script"></script>

Upvotes: 1

Related Questions