Asp.net html脚本标记未使用类型javascript<;脚本类型=";text/html">;?
我在一个html页面上查看源代码时遇到了这个问题Asp.net html脚本标记未使用类型javascript<;脚本类型=";text/html">;?,asp.net,javascript,html,tags,script-tag,Asp.net,Javascript,Html,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 = startI
<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>
//等等。。。。
我以前从未见过这种情况。什么是脚本type=“text/html”
。我不知道这是否有区别,但这是在一个.aspx页面上
这是一种稍后要解析和eval()的占位符吗有人知道这是什么吗
使用过这种方法的人能解释它的好处吗?
具有未知内容类型的脚本元素将被忽略,在这种情况下,浏览器不知道如何执行
text/html
脚本
这是一些JavaScript模板引擎使用的常用技术
另见: