Firefoxを使用する場合、webcomponents-lite.min.js
が必要です。Webコンポーネント-lite.min.jsが順番に読み込まれない
routing.js
スクリプトの前に実行され、負荷
webcomponents-lite.min.js
持っている私のindex.htmlで
:右webcomponents-lite.min.js
前に、Firefoxのrouting.js
負荷のネットワーク]タブを見て、しかし
<script>
// Setup Polymer options
window.Polymer = {
dom: 'shadow',
lazyRegister: true,
};
// Load webcomponentsjs polyfill if browser does not support native
// Web Components
(function() {
'use strict';
var onload = function() {
// For native Imports, manually fire WebComponentsReady so user code
// can use the same code path for native and polyfill'd imports.
if (!window.HTMLImports) {
document.dispatchEvent(
new CustomEvent('WebComponentsReady', {bubbles: true})
);
}
};
var webComponentsSupported = (
'registerElement' in document
&& 'import' in document.createElement('link')
&& 'content' in document.createElement('template')
);
if (!webComponentsSupported) {
var script = document.createElement('script');
script.async = false;
script.src = '/bower_components/webcomponentsjs/webcomponents-lite.min.js';
script.onload = onload;
document.head.appendChild(script);
} else {
onload();
}
})();
</script>
<link rel="import" href="/elements/elements.html">
<link rel="import" href="/elements/my-app.html">
<style>
body {
margin: 0;
font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
line-height: 1.5;
min-height: 100vh;
background-color: #fafafa;
}
</style>
</head>
<body>
<!-- build:remove -->
<span id="browser-sync-binding"></span>
<!-- endbuild -->
<iron-meta key="HOST" value="http://80.40.3.2"></iron-meta>
<my-app></my-app>
<!-- Built with love using Polymer Starter Kit -->
</body>
<script src="/js/routing.js"></script>
を。 routing.js
の前にロードするにはwebcomponents-lite.min.js
が必要なので、これはエラーの原因です。
aysnc
の動作がないため、注文を保証する必要があります。なぜこのようなことが起きているのですか?そして、もっと多くのイベントリスナーを使ってオーバーコーディングせずにこのオーダーを動作させるにはどうしたらいいですか?