<SCRIPT LANGUAGE="JavaScript1.3">
<!--
// This script creates an events link for the current date
var dt = new Date();
var month= dt.getMonth() + 1;
if (month < 10)
month = "0" + month;
var date = dt.getDate();
if (date < 10)
date = "0" + date;
var year = dt.getYear();
if (year < 2000) // Y2K Fix, Isaac Powell
year = year + 1900; // http://onyx.idbsu.edu/~ipowell
document.write("<A HREF='events/" + year + month + "/" + year + month + date + ".html'>Today’s Events</A>");
// End -->
</SCRIPT>
class AppDrawer extends HTMLElement {...}
window.customElements.define('app-drawer', AppDrawer);
<app-drawer></app-drawer>
<template id="app-drawer-template">
<style>#tabs { ... }</style>
<div id="tabs">...</div>
<div id="panels">...</div>
</template>
const t = document.querySelector('#app-drawer-template');
const clone = document.importNode(t.content, true);
document.body.appendChild(clone);
customElements.define('fancy-tabs', class extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({mode: 'open'});
const t = document.querySelector('#app-drawer-template');
const clone = document.importNode(t.content, true);
shadowRoot.appendChild(clone);
}
...
});
<link rel="import" href="../app-drawer.html">
<app-drawer active></app-drawer>
Routing, data binding, app state, authentication, etc.
npm install foobar
import foobar from 'foobar';
<dialog>
, and
Element.prototype.closest
“These are the early days of web components. I think Polymer is going to help more developers start using components. And in the next several years we'll see more contenders like Polymer staying close to native APIs but adding what developers claim is missing from the browser. Add 10 more years and nobody will know what we're talking about.”
@JoshSadler