1. Micha Kops
  2. webcomponents

Commits

Micha Kops  committed 277d7ee

Initial import.

  • Participants
  • Branches master

Comments (0)

Files changed (3)

File README.md

View file
+# Webcomponents
+
+W3C Webcomponents .. best use the latest Chrome..
+
+Open *about:flags* and allow html imports..
+
+----
+
+**2013 Micha Kops / hasCode.com**

File import.html

View file
+<html lang="en" dir="ltr" itemscope itemtype="http://schema.org/Article">
+<head>
+  <meta charset="utf-8">
+  <link rel="import" href="imported.html">
+  <script>
+function importsSupported() {
+  return 'import' in document.createElement('link');
+}
+
+if (importsSupported()) {
+  alert("imports supported");
+} else {
+  alert("imports not supported");
+}
+</script>
+</head>
+<body>
+  <h1>Import</h1>
+  <div id="content"></div>
+<script>
+var content = document.querySelector('link[rel="import"]').import;
+document.getElementById('content').innerHTML = content;
+</script>
+</body>
+</html>

File imported.html

View file
+<ul>
+  <li>Foo</li>
+  <li>Bar</li>
+</ul>