But note that there's also `<script type="application/json">` these days (usually only useful with `id=`) ... and `importmap` I guess.
But note that there's also `<script type="application/json">` these days (usually only useful with `id=`) ... and `importmap` I guess.
It's even more general:
Although 'importmap' has specific functionality, as does 'speculationrules', although they operate similarly. My favorite is type="module" which competes with the higher level attribute nomodule="true". Anyways it looks like <script> has taken a lot of abuse over the years:https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
> My favorite is type="module" which competes with the higher level attribute nomodule="true". Anyways it looks like <script> has taken a lot of abuse over the years:
It "conflicts" in the same way noscript[1] and script "conflict" no? They're basically related features, but can't really be made exclusive because the mere act of trying to do so wouldn't work: as the link indicates, executing code in a !module browser reserves the type (requires a specific set of types) so you can't use that as a way to opt in !module browsers.
[1] an other fun element with wonky parsing rules besides
You can write:
Which is a little weird. At the very least I'd expect the type="module" documentation to say that `charset`, `defer` and `nomodule` attributes have no effect.It does? https://html.spec.whatwg.org/multipage/scripting.html#attr-s...
It specifies it in the abstract. Did you mean to link here instead of to the 'src' attribute documentation?
https://html.spec.whatwg.org/multipage/scripting.html#attr-s....
My expectation was that this condition would have been reflected in MDNs documentation where it breaks the conditions for 'charset' and 'defer' out.
Why? MDN does not purport to be exhaustive, that's the spec's job.
MDN does a pretty good job anyways. Perhaps I feel that it would be in keeping with that spirit to have this condition documented. This is partly because MDN is far easier to read for the purposes of _reference_ than the spec which is easier to read for the purposes of _implementing_. It's also easier to search and to share links to, as the link you presented earlier was both wrong and confusing, and there was no natural way to link to the part of the document you intended.
Perhaps the spec isn't the right tool for every job? That's why, for me, at least.
Submit a change, then. MDN isn't written by some secret cabal. It's written by all of us.
> You can write:
Yes, and you can write
Yes, that option is the real “just do this”.
- escape `<` as `\u003c`
No __proto__ issue, and no dynamic code at all, so you can use a strict CSP.Why does the author ignore this method? Django docs show this as a best practice via a built in tag.