WHATWG spec has interesting step in prepare the script element algorithm:
Otherwise, immediately execute the script element el, even if other scripts are already executing.
What is that case? How does one script may pause of executing another script?
Given the constraints, it's a script that is not a module, does not have a src attribute, and is inserted during a script execution. I think the following example qualifies:
<script>
console.log("before");
document.write(`<script>
console.log("nested");
<\/script>`);
console.log("after");
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With