我可能要求太多,但我试图让 jQuery 模板与在 ie8 中工作的 html5 元素。我正在使用 head.js 以便注册 html5 元素,我也尝试了 html5shiv 但没有运气。页面中还有其他 html5 元素可以正常工作,但是如果我在模板中使用 html5 元素,jquery 模板系统不会返回任何内容。
这是我的一个模板的示例:
<aside>
<script id="sidebar-template" type="text/x-jquery-tmpl">
<section>
<header>${name}</header>
<section>
{{each links}}
<a href="${link}" class="${icon}">${name}</a>
{{/each}}
</section>
</section>
</script>
</aside>
如果我将 html5 元素更改为 div 并填充模板在 ie8 中工作。我应该注意到这个模板适用于所有其他浏览器,这并不奇怪......
我整理了一个 jsfiddle 来展示我的模板:http: //jsfiddle.net/keegan3d/E6EbG/1/
有没有办法让这些 html5 元素在 ie8 中工作?