Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 HTML5 中,script元素可用于数据块:
script
该script元素允许作者在他们的文档中包含动态脚本和数据块。
该type属性给出了内容的 MIME 类型。
type
如果text/html使用,该script元素是否必须包含完整的HTML 文档?或者是否也允许使用片段(如下例所示)?
text/html
<script type="text/html"> <div>Foobar.</div> </script>