-
Notifications
You must be signed in to change notification settings - Fork 386
Open
Labels
Description
(Copied from MicrosoftEdge/MSEdgeExplainers#9, which has some additional discussion before leaving the issue for future consideration; filing here to ensure it gets properly recorded.)
Originally filed by @phistuck:
Define a new HTML content attribute, export
or exportname
or namedexport
(and defaultexport
?) or something similar that allows elements to be exported without any inline scripts.
<!-- module.html -->
<div namedexport="content">
Warning - this might hurt.
</div>
// main.js
import {content} from "module.html";
document.body.appendChild(content);
I imagine some HTML modules might have no scripting logic, they would only exist to share content and inline scripts are too wordy for those cases.
That could maybe make them available from HTML directly as well...
<!-- Bonus -->
<!-- page.html -->
<content import="module.html" namedimport="content"></content>
A little bit like server-side includes. But this is crazy talk.
justinfagnani, bahrus, hober, pmdartus, ByteEater-pl and 5 moremarkcellus