. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
. , JS .
import.html
<template> <h1>Hello World!</h1> <!-- Img is not requested until the <template> goes live. --> <img src=""> <script>alert("Executed when the template is activated.");</script> </template>
index.html
<head> <link rel="import" href="import.html"> </head> <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').appendChild(clone); </script> </body>
-, HTML-. , , . .
elements.html
<script> // Define and register <say-hi>. var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { this.innerHTML = 'Hello, <b>' + (this.getAttribute('name') || '?') + '</b>'; }; document.registerElement('say-hi', {prototype: proto}); // Define and register <shadow-element> that uses Shadow DOM. var proto2 = Object.create(HTMLElement.prototype); proto2.createdCallback = function() { var root = this.createShadowRoot(); root.innerHTML = "<style>::content > *{color: red}</style>" + "I'm a " + this.localName + " using Shadow DOM!<content></content>"; }; document.registerElement('shadow-element', {prototype: proto2}); </script>
( ) : <say-hi>
<shadow-element>
. - .
index.html
<head> <link rel="import" href="elements.html"> </head> <body> <say-hi name="Eric"></say-hi> <shadow-element> <div>( I'm in the light dom )</div> </shadow-element> </body>
, HTML- -.
, , , 1 .
- . , , .
. tab (<polymer-ui-tabs>)
layout
selector
. HTML-.
polymer-ui-tabs.html
<link rel="import" href="polymer-selector.html"> <link rel="import" href="polymer-flex-layout.html"> <polymer-element name="polymer-ui-tabs" extends="polymer-selector" ...> <template> <link rel="stylesheet" href="polymer-ui-tabs.css"> <polymer-flex-layout></polymer-flex-layout> <shadow></shadow> </template> </polymer-element>
:
<link rel="import" href="polymer-ui-tabs.html"> <polymer-ui-tabs></polymer-ui-tabs>
, <polymer-selector2>
, <polymer-selector>
. -, polymer-ui-tabs
.
, JQuery, . , ? , HTML-! .
, . . . jquery.html, JQuery.
jquery.html
<script src="http://cdn.com/jquery.js"></script>
:
import2.html
<link rel="import" href="jquery.html"> <div>Hello, I'm import 2</div>
ajax-element.html
<link rel="import" href="jquery.html"> <link rel="import" href="import2.html"> <script> var proto = Object.create(HTMLElement.prototype); proto.makeRequest = function(url, done) { return $.ajax(url).done(function() { done(); }); }; document.registerElement('ajax-element', {prototype: proto}); </script>
, jquery.html:
<head> <link rel="import" href="jquery.html"> <link rel="import" href="ajax-element.html"> </head> <body> ... <script> $(document).ready(function() { var el = document.createElement('ajax-element'); el.makeRequest('http://example.com'); }); </script> </body><source lang="html">
cdn.com/bootstrap.html
cdn.com/bootstrap.html
contains nested resources, but they are also cached. var link = document.createElement('link'); link.rel = 'stylesheet'; link.href = 'styles.css';
link
element is added to the DOM: document.head.appendChild(link); // browser requests styles.css
var h2 = document.createElement('h2'); h2.textContent = 'Booyah!';
h2
element will not change anything until you add it to the DOM. , . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
, . , , :
<head> <link rel="import" href="/path/to/import_that_takes_5secs.html"> <script>console.log('I block page rendering');</script> </head>
, . .
#1 ():
, . , !? ;)
:
<head> <link rel="import" href="/path/to/import.html"> <link rel="import" href="/path/to/import2.html"> <!-- avoid including script --> </head> <body> <!-- avoid including script --> <div id="container"></div> <!-- avoid including script --> ... <script> // Other scripts n' stuff. // Bring in the import content. var link = document.querySelector('link[rel="import"]'); var post = link.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script> </body>
.
1.5:
, . , :
import.html:
<div id="blog-post">...</div> <script> var me = document.currentScript.ownerDocument; var post = me.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); </script>
index.html
<head> <link rel="import" href="/path/to/import.html"> </head> <body> <!-- no need for script. the import takes care of things --> </body>
#2:
, , . Google Analytics , . , :
<head> <script> function addImportLink(url) { var link = document.createElement('link'); link.rel = 'import'; link.href = url; link.onload = function(e) { var post = this.import.querySelector('#blog-post'); var container = document.querySelector('#container'); container.appendChild(post.cloneNode(true)); }; document.head.appendChild(link); } addImportLink('/path/to/import.html'); // Import is added early :) </script> <script> // other scripts </script> </head> <body> <div id="container"></div> ... </body>
, .
<head> <script> // other scripts </script> </head> <body> <div id="container"></div> ... <script> function addImportLink(url) { ... } addImportLink('/path/to/import.html'); // Import is added very late :( </script> </body>
: - . .
mime- , text/html
(CORS) URL . , . . "# ". " , ". , , . : . HTML- , " ".
HTML- HTML/CSS/JS , . , , -. ,
.
HTML- , .
HTML/CSS/JS . , . - , . . . , , , . - . - JS , , . , . !
:
<script>/* script chunk A goes here */</script> <script>/* script chunk B goes here */</script> <script>/* script chunk C goes here */</script> ...
HTML- - HTML- .
. , .
Source: https://habr.com/ru/post/231845/
All Articles