简体   繁体   中英

HTML <script type=template> official?

除了HTML5中模板标签之外 ,我想知道这种类型的脚本标签<script type="text/template">是否符合HTML标准?

According to the spec :

The script element allows authors to include dynamic script and data blocks in their documents.

So including a template there is fine.

text/template , however, is not a registered MIME type so text/x-template would be more appropriate ( x- is the traditional prefix for experimental MIME types).

its an old question but it was asked a few years ago: Explanation of <script type = "text/template"> ... </script>

by the looks of it it isn't official. Just a way for you to incorperate other code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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