对象不支持platform.js和IE11中的属性或方法'getAttribute'错误

时间:2014-09-03 20:33:16

标签: javascript polymer internet-explorer-11

从IE 11和Polymer / platform

获取以下错误
SCRIPT438: Object doesn't support property or method 'getAttribute'
File: platform.js, Line: 12, Column: 30816

我有以下meta decalared。

<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />

该网站在Chrome中运行良好。所以我想它必须是一个可比性问题。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

如果你正在使用XHTML,那么自动关闭代码可能是一个问题:

  

以XHTML的形式提供页面将允许自动关闭标签,但是会破坏一些脚本。

     

例如,我创建了这个元素:

<link rel="import" href="../bower_components/polymer/polymer.html"/>
<polymer-element name="copyright-statement" attributes="copyrightStart">
  <template>
    <span>
      &#169; {{copyrightStart}}{{thisYear}}
    </span>
  </template>
  <script>
    Polymer('copyright-statement',{
        copyrightStart:2014,
        created: function() {
            console.log("The copyright-statement has been registered.");
        },
        ready: function() {
            this.thisYear = new Date().getFullYear();
            if(this.copyrightStart != null) {
                if(parseInt(this.copyrightStart) < this.thisYear) {
                    this.copyrightStart = this.copyrightStart + " \u2014 ";
                } else {
                    this.copyrightStart = "";
                }
            }
        }
    });
  </script>
</polymer-element>

<强>参考