Embedded JavaScript engine, a dialect of sjs-4 that is similar to PHP.
Embed JavaScript code into HTML similar to PHP.
The code will be transpiled to sjs-4
before being executed,
thus you can use the API of the sjs-4
engine.
Source mapping is not implemented yet. When an error is encountered, the row will be reported correctly, while the column (char position) will be incorrect.
There are only a couple of syntax elements to be aware of:
<? ... ?>
,<?= foo ?>
,<?== foo ?>
,print()
.Example without JS code.
Multiline example without JS code.
Write HTML escaped output to the output buffer.
Write raw unescaped output to the output buffer.
Comment.
Embed JS for control flow, no output.
You can call print() to write to the output buffer.
Closing tag is optional.
Empty code block is fine.
Printing <?
and ?>
.
The line number is reported correctly, the column number incorrectly.
Spaces must be used between <?
and the comment
block.