<script> var div = document.querySelector('#shadow'); var root = div.createShadowRoot(); var template = document.querySelector('#t1'); var node = document.importNode(template.content, true); root.appendChild(node); </script>
<script> var div = document.querySelector(‘#shadow'); var root = div.createShadowRoot(); var template = document.querySelector('#t1'); var node = document.importNode(template.content, true); root.appendChild(node); </script> 4IBEPX%0.ͰͷΈ༗ޮ
</template> <script> var proto = Object.create(HTMLElement.prototype); var importDoc = document.currentScript.ownerDocument; proto.createdCallback = function () { var root = this.createShadowRoot(); var t = importDoc.querySelector('template'); var clone = document.importNode(t.content, true); root.appendChild(clone); } document.registerElement('my-element2', {prototype: proto}); </script> 5FNQMBUF $VTUPN&MFNFOU 4IBEPX%0. JNQPSUIUNM
<dom-module id="my-element"> <template> <p>I'm a My element. This is my local DOM!</p> </template> <script> Polymer({ is: "my-element" }); </script> </dom-module>
‘my-calculator’, numberClick: function (e) {/**/}, calcClick: function (e) { var formula = this.display; var result = calc(formula); this.display = result; } }); $BMDVMBUPSNZDBMVDMBUPSIUNMɿৼΔ͍ᶄ Πϕϯτొ ॲཧΛఆٛ͢Δ