EJS - Embedded JavaScript
EJS stands for Embedded JavaScript. It is one the JavaScript templating library.
As we know the data/information we view on the various websites is not static. We are rendering the data from external sources like database,json etc. This data needs to be handled along with HTML to make the content dynamic, it becomes difficult to understand as we concatinate the strings with the
In order to display the data in between HTML we need to follow special syntax depending upon the requirement. EJS is a combination of plain JavaScript and HTML that enable you to design templates in a more systematic way.
Following is the site that provides complete information about EJS:
Embedded JavaScript
Syntax followed in creating EJS templates :
As we know the data/information we view on the various websites is not static. We are rendering the data from external sources like database,json etc. This data needs to be handled along with HTML to make the content dynamic, it becomes difficult to understand as we concatinate the strings with the
In order to display the data in between HTML we need to follow special syntax depending upon the requirement. EJS is a combination of plain JavaScript and HTML that enable you to design templates in a more systematic way.
Following is the site that provides complete information about EJS:
Embedded JavaScript
Syntax followed in creating EJS templates :
- For the code that needs to be executed, it needs to placed in <% .....%> this format.
- For displaying the text through variable yo need to place in <%= variable %>.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment