1

在 Internet Explorer 8 下尝试将带有 html5 元素的 dojo 小部件模板用作父元素时出现错误。这不会在 Firefox 或 Chrome 下发生,也不会在较新版本的 Internet Explorer 下发生。

这是一个以声明方式包含在页面上的标准 dojo 小部件,例如:

<div data-dojo-type="some/path/to/master/Footer"></div>

Footer.js 很简单:

define([
    "dojo/_base/declare",
    "dijit/_WidgetBase",
    "dijit/_TemplatedMixin",
    "dijit/_WidgetsInTemplateMixin",
    "dojo/text!./templates/footer.html",
    "dojo/i18n!./nls/footer"
], function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template, i18n){
    return declare("some.path.to.Footer", [ _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
        templateString: template,
        i18n: i18n
    });
});

我在 Internet Explorer 8 控制台中看到的错误:

Error: Invalid template: <footer class="footer-wrapper gradient3">(...)

footer如果我将元素包装在另一个 div 中以使页脚不是父元素,我也不会看到此错误,例如:

<div>
<footer class="footer-wrapper gradient3">

我找不到任何关于这个问题的提及,有没有人听说过这样的问题?

4

0 回答 0