【发布时间】:2012-10-30 17:00:56
【问题描述】:
可能重复:
Explanation of <script type = “text/template”> … </script>
在开始学习backbone.js之后,我想知道浏览器遇到时到底会做什么
<script type= text/template>
...
</script>
http://bytes.com/topic/html-css/answers/542484-browser-behavior-unknown-tags-attributes 人们正在解释如果看到未知标签会发生什么,但在这种情况下标签是已知的并且浏览器知道如何处理它,问题在于类型。
所以问题是:
- 它会尝试执行它吗?
- 是忽略了吗?
为什么我们需要<script type= text/template>...</script>,为什么我们不能使用<div style="display:none"> ... </div>?
【问题讨论】:
-
HTML 元素信息的最佳起点是 HTML 规范,谷歌搜索“site:w3.org html the-element-you-want”,将搜索限制在 w3.org 以避免垃圾像 w3fools.com。阅读
<script>:w3.org/TR/html-markup/script.html