Skip to content

Instantly share code, notes, and snippets.

@sjmiles
Last active December 15, 2015 05:19
Show Gist options
  • Save sjmiles/5207722 to your computer and use it in GitHub Desktop.
Save sjmiles/5207722 to your computer and use it in GitHub Desktop.
Basic example using Web Components/Custom Elements
<!DOCTYPE html>
<!--
Copyright 2013 The Toolkitchen Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html>
<head>
<title></title>
<meta charset="UTF-8">
<script src="../../../WebComponents/web-components.js"></script>
<script src="../../../CustomElements/custom-elements.js"></script>
</head>
<body>
<x-foo></x-foo>
<element name="x-foo">
<script>
this.register && this.register({
prototype: {
readyCallback: function() {
this.textContent = 'Hello World';
}
}
});
</script>
</element>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment