Last active
March 24, 2017 18:14
-
-
Save jrunning/d0404cb9fdc32fd8b645bbf00b342495 to your computer and use it in GitHub Desktop.
load-order-test
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
<script src="test-script.js"></script> | |
<script> | |
console.log('Hello from test-child.html'); | |
</script> | |
<!-- output: | |
Hello from test-script.js | |
Hello from test-child.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
<!doctype html> | |
<html> | |
<body> | |
<iframe src="test-child.html"></iframe> | |
<script> | |
console.log('Hello from test-iframe-parent.html'); | |
</script> | |
</body> | |
</html> | |
<!-- output: | |
Hello from test-iframe-parent.html | |
Hello from test-script.js | |
Hello from test-child.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
<!doctype html> | |
<html> | |
<body> | |
<link rel="import" href="test-child.html"/> | |
<script> | |
console.log('Hello from test-import-parent.html'); | |
</script> | |
</body> | |
</html> | |
<!-- output: | |
Hello from test-script.js | |
Hello from test-child.html | |
Hello from test-import-parent.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
<!doctype html> | |
<html> | |
<body> | |
<script> | |
let template = document.createElement('template'); | |
template.innerHTML = ` | |
<script src="test-script.js">\x3c/script> | |
<script> | |
console.log('Hello from imported template content'); | |
\x3c/script> | |
`; | |
document.body.appendChild(document.importNode(template.content, true)); | |
console.log('Hello from test-inject-parent.html'); | |
</script> | |
</body> | |
</html> | |
<!-- output: | |
Hello from imported template content | |
Hello from test-inject-parent.html | |
Hello from test-script.js | |
--> |
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
console.log('Hello from test-script.js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment