Skip to content

Instantly share code, notes, and snippets.

@rakeden
Created June 1, 2016 18:55
Show Gist options
  • Save rakeden/64e24fadd2561e0e49fab73b3966fa70 to your computer and use it in GitHub Desktop.
Save rakeden/64e24fadd2561e0e49fab73b3966fa70 to your computer and use it in GitHub Desktop.
# head
<link rel="import" href="partials/header.html">
# body
<div id="container"></div>
<script>
var link = document.querySelector('link[rel="import"]');
// Clone the <template> in the import.
var template = link.import.querySelector('template');
var clone = document.importNode(template.content, true);
document.querySelector('#container').parentNode.replaceChild(clone, document.querySelector('#container'));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment