Created
March 10, 2017 11:25
-
-
Save tareko/62fd670a88e2a75fce518c39b4c83e78 to your computer and use it in GitHub Desktop.
HTML5 import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/polymer/0.3.3/platform.js"></script> | |
<link rel="import" href="messages.html"/> | |
</head> | |
<body> | |
<h2>title</h2> | |
<script> | |
alert("document "+document); | |
var htmlImport = document.querySelector('link[rel="import"]'); | |
var htmlDoc = htmlImport.import; | |
alert("htmlDoc "+htmlDoc); | |
var htmlMessage = htmlDoc.querySelector('.message-success'); | |
alert("htmlMessage "+htmlMessage); | |
document.body.appendChild(htmlMessage.cloneNode(true)); | |
</script> | |
<p>end</p> | |
<a href="messages.html">messages</a> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<div class="message-success"> | |
<h2>Success</h2> | |
</div> | |
<div class="message-failure"> | |
<h2>Failure</h2> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks,
My expectation was that the snippet
would be included in the
document
forbase.html
after the<body>
element