3 ms·
This is great! Locality of Behaviour is of special interest to me. How is your experience with currentScript.parentElement? Last month I did a quick research
by hu3 2y ago
This is great!
Locality of Behaviour is of special interest to me.
How is your experience with currentScript.parentElement?
Last month I did a quick research and my impression is that it wasn't reliable in some probably niche case but I can't remember when.
But I didn't investigate much and I'm glad you made it work!
If I load 3 consecutive scripts currentScript.parentElement should still work in all browsers right? As long as it is not async or module, which is fine with me.
SvelteKit had this conversation and they ended up implementing random ids for elements to set their targets:
https://github.com/sveltejs/kit/issues/2221 https://github.com/sveltejs/kit/issues/2221