Possible Duplicate:
Explanation of <script type = “text/template”> … </script>
After starting learning backbone.js I am wondering what exactly browser does when it encounters
<script type= text/template>
...
</script>
http://bytes.com/topic/html-css/answers/542484-browser-behavior-unknown-tags-attributes people are explaining what happens if it sees unknown tab, but in this case the tag is known and the browser knows what to do with it, the problem is with type.
So the questions are:
- does it try to execute it?
- is it ignoring it?
Why exactly do we need <script type= text/template>...</script>, why just we can not use <div style="display:none"> ... </div>?
Browser simply ignores such tags.
It’s useful to put templates inside such tags, because you don’t need to encode HTML symbols like
<,>,&for example:Inside the hidden div you should write something like this: