Need help with JavaScript? Hire the experts at Bitovi



<% Embedded JavaScript %>

Download EJS
Developer 1.0 Production (9.8KB)

EJS is a client-side templating language that was originally part of JavaScriptMVC, which has now been replaced by DoneJS.

Try it!

The Data.

{ title: 'Cleaning Supplies'
supplies: ['mop', 'broom', 'duster'] }

EJS combines data and a template to produce HTML. Here, our example data has a title and a list of supplies.

The Template.

Type here

Like ERB, JavaScript between <% %> is executed. JavaScript between <%= %> adds HTML to the result.

Type HTML or JavaScript in the template
Watch as your changes update the result.

Try typing these suggestions:
Insert "<h1> <%= title %> </h1>"

The Result.

The result is shown here

The result on the right is the output of the template processed with the data.

If you make a mistake, EJS provides the line number and a message for easier debugging.

Use it.


Built by:



// load a template file, then render it with data
html = new EJS({url: '/template.ejs'}).render(data)

// update element 'todo' with the result of a  
// template rendered with data from a JSON request
new EJS({url:'/todo.ejs'}).update('todo','/todo.json')