The spec says no:
[Scripts] parsed into different Documents than the one the parser was created for do not execute
But Edge, Chrome and Safari all allow it. Reduced test (see the console) - source.
I really like how this silly hack allows you to inject content in a streaming manner in a way that's very close to how a regular page-load behaves, including executing scripts, but some kind of streaming document fragment would be a better way to deliver that.
The spec says no:
But Edge, Chrome and Safari all allow it. Reduced test (see the console) - source.
I really like how this silly hack allows you to inject content in a streaming manner in a way that's very close to how a regular page-load behaves, including executing scripts, but some kind of streaming document fragment would be a better way to deliver that.