Created
February 17, 2017 16:31
-
-
Save robdodson/a3a3339042f3bee81c662e65ac0501d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var onload = function() { | |
| // If web components are supported this will fire immediately, | |
| // othewrise it will wait for the polyfills to load. | |
| // Load your components here | |
| var components = document.createElement('script'); | |
| script.async = true; | |
| script.src = '../dist/page-sections.js'; | |
| document.head.appendChild(components); | |
| }; | |
| var webComponentsSupported = ( | |
| 'registerElement' in document | |
| ); | |
| if (!webComponentsSupported) { | |
| var script = document.createElement('script'); | |
| script.async = true; | |
| script.src = '/bower_components/webcomponentsjs/webcomponents-lite.min.js'; | |
| script.onload = onload; | |
| document.head.appendChild(script); | |
| } else { | |
| onload(); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment