简体   繁体   English

带花括号的HTML代码

[英]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. 我最近看到了一个HTML页面,代码中嵌入了花括号,标签和循环的值由花括号关闭。

            {% 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? HTML是否嵌入了其他任何语言?

This looks like the HTML is enriched with underscore.js or a similar templating engine. 看起来HTML包含了underscore.js或类似的模板引擎。

It's used for displaying JavaScript data in your HTML without the need to know how JavaScript works. 它用于在HTML中显示JavaScript数据,而无需了解JavaScript的工作方式。

This may be Django script templates. 这可能是Django脚本模板。 Find more here. 在这里找到更多

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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