【发布时间】:2020-04-30 11:41:21
【问题描述】:
在非 Chrome 浏览器 (Firefox/IE) 上使用 Google Polymer 时经常遇到问题。单独使用 Polymer(例如查看 Polymer Element 演示页面)似乎不会导致任何问题。但是,当使用 webcomponents.js 包含在包含许多 GUI 和实用程序包(jQueryUI,
这个问题似乎与 webcomponents.js 相关。如果没有使用 HTML 导入并且 仅 webcomponents.js 被导入,它会在 Firefox 和 IE 中引发相同的错误:
webcomponents.js:2114 - SyntaxError: An invalid or illegal string was specified
webcomponents.js:113 - Error: Assertion failed
webcomponents.js 的具体行简单写成:
list = originalDocumentQuerySelectorAll.call(target, selector);
- 似乎没有立即明显的语法错误。
由于此错误,页面上的其他 GUI 元素现在表现出错误行为。发生这种情况时没有提供其他有用的控制台输出,也没有其他 JS 包抛出异常。使用 Chrome 时不会显示此行为。
【问题讨论】:
标签: javascript html firefox polymer