Get started with ejs CDN

Apache-2.0 licensed

EJS: Node.js app templating, dynamic HTML with embedded JS.

Tags:
  • template
  • engine
  • ejs

Stable version

Copied!

How to start using ejs CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with ejs CDN - cdnhub.io</title>
    <script src="https://cdn.cdnhub.io/ejs/3.1.9/ejs.min.js"></script>
</head>
<body>
    <script type="text/ejs" id="template">
        <h1>Hello, <%= name %>!</h1>
    </script>
    <script type="text/javascript">
        const source = document.getElementById('template').textContent;
        const template = ejs.compile(source, { filename: 'template.ejs' });
        const html = template({ name: 'John Doe' });
        document.body.innerHTML = html;
    </script>
</body>
</html>

All versions