Html Imports Load Order In Internet Explorer
I have a web page that renders some Polymer 1.0 custom elements. In the head section of my index.html file I have the following: &
Solution 1:
You're right, it's because IE is using a polyfill, so the <link>
tag is no proceeded sequentially.
The workaround is to listen to the HTMLImportsLoaded
event fired by the webcomponents-lite.js
library when the HTML Import is loaded.
<linkrel="import"href="my-elements.html"><script>document.addEventListener( "HTMLImportsLoaded", function () {
var s1 = document.createElement( "script" )
var s2 = document.createElement( "script" )
s1.setAttribute( "src", "script1.js" )
s2.setAttribute( "src", "script2.js" )
document.head.appendChild( s1 )
document.head.appendChild( s2 )
} )
</script>
Post a Comment for "Html Imports Load Order In Internet Explorer"