By setting the type to "text/template", it's not a script that the browser can understand, and so the browser will simply ignore it. This allows you to put anything in there, which can then be extracted later and used by a templating library to generate HTML snippets.

yamadaryamadar のブックマーク 2014/04/01 15:03

その他

このブックマークにはスターがありません。
最初のスターをつけてみよう!

Explanation of <script type = "text/template"> ... </script>

    I just stumbled upon something I've never seen before. In the source of Backbone.js's example TODO application (Backbone TODO Example) they had their templates inside a <script type="text/template"...

    \ コメントが サクサク読める アプリです /

    • App Storeからダウンロード
    • Google Playで手に入れよう