简体   繁体   中英

HTML code with curly braces

I have recently seen one HTML page.The code is embed with curly braces.Values for tags and loops are closed by curly braces.

            {% if authenticated %}
            <h1>Current User</h1>
            <p>{{user}}</p>
            {% else %}
            <h1>Current User</h1>
            <p>None</p>
            {% endif %} 

What is the actaul use of these type of code?

Is HTML embedded with any other language?

This looks like the HTML is enriched with underscore.js or a similar templating engine.

It's used for displaying JavaScript data in your HTML without the need to know how JavaScript works.

This may be Django script templates. Find more here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM