html脚本标签不使用类型javascript <script type ="text/html">?

Ken*_*h J 14 html javascript asp.net tags script-tag

我正在检查html页面上的源代码并遇到了这个问题

<script id="searchItemTemplate" type="text/html"> 
    <# var rows = Math.floor((Model.RecordsPerPage - 1) / 3 + 1);
       for (var i = 0; i < rows; ++i){
        var startIdx = i * 3;
        var endIdx = startIdx + 3;
    #>
//etc .... 
</script>
Run Code Online (Sandbox Code Playgroud)

我以前从未见过这个.什么是剧本type="text/html".我不知道它是否有所作为,但这是在.aspx页面上.

这是某种占位符需要解析和eval()以后吗?
有谁知道这是什么?
使用这种方法的人可以解释这些好处吗?

CMS*_*CMS 17

简单地忽略具有未知内容类型的脚本元素,在这种情况下,浏览器不知道如何执行text/html脚本.

这是一些JavaScript模板引擎使用的常用技术.

也可以看看: