Server Side JavaScript Features

Server Side JavaScript code is executed in files ending in sjs.
var today = new Date();

Embedded JavaScript files can contain any text content and JavaScript.

  <% var today = new Date(); %>
      Today is <%=today%>!

E4X is supported.
Easily import, manipulate and export XML data using JavaScript

Embedded JavaScript Macros
Macros are html-like contructs that make JavaScript loops and conditionals easier to implement in ".ejs" files.
See @loop and @if.

Embedded JavaScript Blocks
EJS blocks work like ".ejs" pages but can be used in JavaScript code to return a string. All text between <ejs> and </ejs> will be returned as if it was included from a ".ejs" page. This makes it much easier to embed other languages like SQL or HTML in JavaScript strings.

var qry = new Myna.Query({
        select * FROM article where
            id = <%=$> 
            <@if !includeDeleted>
            and deleted != 1